You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: all references of "web ui" refers to either Github or Gitlab web sites. Everything listed can also be done using CLI but most people tend to use the web ii
(on web ui)
Create issue (issue-123)
From the issue create a branch (issue-123)
(laptop)
git pull will get the remote branch
Do your work, commit, push to remote branch
(on web ui)
merge back to master (or other active dev branch)
The problem is that on your laptop branch issue-123 still exists but is not required anymore as it doesn't exists on remote. To date this is a manual cleanup job that can become tedious when lots of issues and branches are created (especially with larger projects). Need ability to quickly and easily remove local branches that no longer exists locally.
A common workflow is to do the following:
Note: all references of "web ui" refers to either Github or Gitlab web sites. Everything listed can also be done using CLI but most people tend to use the web ii
issue-123
)issue-123
)git pull
will get the remote branchmaster
(or other active dev branch)The problem is that on your laptop branch
issue-123
still exists but is not required anymore as it doesn't exists on remote. To date this is a manual cleanup job that can become tedious when lots of issues and branches are created (especially with larger projects). Need ability to quickly and easily remove local branches that no longer exists locally.Idea:
Create a
git alias
to handle this commandgit branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -d
To create the git alias automatically see: https://www.reddit.com/r/git/comments/32s8fr/how_to_store_gitconfig_as_part_of_the_repository/ and https://stackoverflow.com/questions/18329621/how-to-store-a-git-config-as-part-of-the-repository
helper.sh
so that it will always add the.gitshared
file into the local.gitconfig
fileNeed to think of a name for this git alias. Some ideas: https://medium.com/better-programming/useful-configs-and-aliases-for-git-and-local-development-environments-b7a0822591a6
The text was updated successfully, but these errors were encountered: