Git tips from the trenches
ochronus.com
Git tips from the trenches
1–10 of 47 posts
Re: Git tips from the trenches
#2 does this actually work? `git branch --merged` for me also
returns '* master', which when xarg'd would include the '*'
and also 'master'. I don't want to delete master, and I
certainly dont want to delete * if it globs.
EDIT: made this into a code block as I have no idea how to make asterisks display.Re: Git tips from the trenches
#3> $ git branch --merged | xargs git branch -d does this actually work? `git branch --merged` for me also returns '* master', which when xarg'd would include the '*' and also 'master'. I don't want to delete master, and I certainly dont want to delete * if it globs. EDIT : made this into a code block as I have no idea how to make asterisks display.
error: Cannot delete the branch 'master' which you are currently on.
Re: Git tips from the trenches
#4> $ git branch --merged | xargs git branch -d does this actually work? `git branch --merged` for me also returns '* master', which when xarg'd would include the '*' and also 'master'. I don't want to delete master, and I certainly dont want to delete * if it globs. EDIT : made this into a code block as I have no idea how to make asterisks display.
Re: Git tips from the trenches
#5 git rev-list --all | xargs git grep ''Re: Git tips from the trenches
#6 git blame -w
Ignore the whitespace if a block was [un]indented, attribute to original author instead of person re-indenting due to control structure change around block.Re: Git tips from the trenches
#7 git bisect
If you're ever looking for "the commit that broke feature XYZ", git bisect is your trusty minion.Re: Git tips from the trenches
#8> $ git branch --merged | xargs git branch -d does this actually work? `git branch --merged` for me also returns '* master', which when xarg'd would include the '*' and also 'master'. I don't want to delete master, and I certainly dont want to delete * if it globs. EDIT : made this into a code block as I have no idea how to make asterisks display.
Re: Git tips from the trenches
#9I'd like to mention a feature that's been making my life oh so much easier: git bisect If you're ever looking for "the commit that broke feature XYZ", git bisect is your trusty minion.
Re: Git tips from the trenches
#10> $ git branch --merged | xargs git branch -d does this actually work? `git branch --merged` for me also returns '* master', which when xarg'd would include the '*' and also 'master'. I don't want to delete master, and I certainly dont want to delete * if it globs. EDIT : made this into a code block as I have no idea how to make asterisks display.
alias gclean='git remote prune origin; git branch --merged | grep -v -E "(\*|master)" | xargs -n 1 git branch -d'