Earlier quoted context omitted.
Yoy dirty, I hope Mr Gandalf pipeline, say the words!
You shall not pass! But I'm a demon and I'm taking my commit with me to the depths of hell
Ask HN: What are some Git aliases you setup that save you time?
31–35 of 35 posts
Re: Ask HN: What are some Git aliases you setup that save you time?
#32Here are a couple that I use a lot. There's probably a shorter way to write them: # show the last 10 branches I used lb = !git reflog show --pretty=format:'%gs ~ %gd' --date=relative | grep 'checkout:' | grep -oE '[^ ]+ ~ .*' | awk -F~ '!seen[$1]++' | head -n 10 | awk -F' ~ HEAD@{' '{printf(\" \\033[33m%s: \\033[37m %s\\033[0m\\n\", substr($2, 1, length($2)-1), $1)}' # checkout the previous branch I was using cop = !…
git checkout -
(The same way you can use ‘cd -‘ to change to your previous directory)Re: Ask HN: What are some Git aliases you setup that save you time?
#33resync = git checkout master && git pull && git checkout - && git pull --rebase master asquash = git rebase -i master --autosquash abs = git absorb -b HEAD~20 everything else is handled by vim-fugitive
What is ‘absorb’? Never seen before. What is it for?
Re: Ask HN: What are some Git aliases you setup that save you time?
#34Re: Ask HN: What are some Git aliases you setup that save you time?
#35Here are a couple that I use a lot. There's probably a shorter way to write them: # show the last 10 branches I used lb = !git reflog show --pretty=format:'%gs ~ %gd' --date=relative | grep 'checkout:' | grep -oE '[^ ]+ ~ .*' | awk -F~ '!seen[$1]++' | head -n 10 | awk -F' ~ HEAD@{' '{printf(\" \\033[33m%s: \\033[37m %s\\033[0m\\n\", substr($2, 1, length($2)-1), $1)}' # checkout the previous branch I was using cop = !…
Unless I’m misunderstanding you can checkout your previous branch with git checkout - (The same way you can use ‘cd -‘ to change to your previous directory)