In git it would be helpful to be able to easily delete the previous branch I was on. You can't delete the branch you're on so you need to check out a new/existing branch and delete the previous you where on by writing it's full name.
git checkout new_branch
git branch -D old_branch_with_really_long_and_hard_name
What I really want is to be able to do this:
git checkout new_branch
git branch -D -
-
doesn't work, but -
is just an alias for @{-1}
and that does work. So you workflow would be this:
git checkout new_branch
git branch -D @{-1}
Amendment:
Turning this into the git alias git done
:
git config --global alias.done '!f() { git checkout master && git branch -D @{-1}; }; f'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With