Skip to content

Commit

Permalink
Quality improvements on gmaintenance
Browse files Browse the repository at this point in the history
  • Loading branch information
GMadorell committed Mar 25, 2022
1 parent 99ad0e8 commit 0539005
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -862,9 +862,16 @@ alias grshow_all="grinfo"
function gmaintenance() {
# Switch to a head branch
git remote show origin | grep "HEAD branch" | cut -d ":" -f 2 | xargs git checkout
gpl
git remote prune origin
# Remove "gone" branches
git branch -vv | grep ': gone]'| grep -v "\*" | awk '{ print $1; }' | xargs -r git branch -D
# Store gone branches
git branch -vv | grep ': gone]'| grep -v "\*" | awk '{ print $1; }' > /tmp/gmaintenance.txt

# Give some room to edit branches
vim /tmp/gmaintenance.txt

# Delete them
xargs git branch -D </tmp/gmaintenance.txt
}

function gcurrent_branch_name() { git rev-parse --abbrev-ref HEAD ; }
Expand Down

0 comments on commit 0539005

Please sign in to comment.