| domain | mahmoudashraf.dev |
| summary | This shell snippet provides a concise way to keep local Git branches synchronized with the remote repository by automatically removing branches that have been deleted on the remote. It achieves this using a series of commands:
* `gcln` (alias) - Represents the overall command. * `git fetch -p` - Fetches updates from the remote, but *prunes* (removes) remote-tracking branches that no longer exist on the remote. * `git branch -vv` - Lists all local branches and their corresponding remote tracking branches, along with their upstream tracking information. * `grep : gone` - Filters the output of `git branch -vv` to identify branches that are marked as "gone" (deleted remotely). * `awk 'print $1'` - Extracts the branch names from the filtered output. * `xargs -r` - Takes the extracted branch names and passes them as arguments to the next command. * `git branch -DMahmoud Ashraf` - Deletes the local branches matching the names identified by the previous commands. (This is an example branch name, likely for testing).
In essence, this alias automates the process of cleaning up your local Git branches to match the current state of the remote repository. |
| title | Home – Mahmoud Ashraf |
| description | Mahmoud Ashraf is a Front-end developer based in Alexandria, Egypt. |
| keywords | recent, thoughts, front, using, blogs, branches, branch, games, website, blog, uses, contact, tracker, light, mode, welcome, space |
| upstreams |
|
| downstreams |
|
| nslookup | A 35.157.26.135, A 63.176.8.218 |
| created | 2025-11-08 |
| updated | 2025-11-08 |
| summarized | 2026-02-07 |
|
|