Bureaucrats, confirmed, Administrators
4,558
edits
m (fix formatting) |
(Cleanup your merged branches) |
||
Line 50: | Line 50: | ||
* checkout a remote branch, setting the local one to track <code>git checkout -t freephile/patch-1</code> | * checkout a remote branch, setting the local one to track <code>git checkout -t freephile/patch-1</code> | ||
== Delete local and remote merged branches == | |||
<source lang="bash"> | |||
git branch --merged | egrep -v "(^\*|master|dev)" | xargs -I % echo 'git branch -d % ; git push --delete freephile % ;' | |||
</source> | |||
Using '''echo''' helps you look before you leap. '''%''' is the replacement string in <code>xargs</code>. Change '<code>echo</code>' to '<code>sh -c</code>' to execute. Does both local and remote prunes. | |||
== Git Log == | == Git Log == |