Hacker News new | ask | show | jobs
by joehx2 808 days ago
I've recently discovered `git switch -` and `git merge -`. It switches to the previous branch you were on or merges the previous branch you were own.

No need to know the name.

So if I need to pull updates on the previous branch I was on and merge them into my current branch, I can just:

    git switch -
    git pull
    git switch -
    git merge -
2 comments

For those who may not know, `cd -` brings you to the previous directory.
Unfamiliar with 'switch'; i do 'git checkout -' all the time to toggle back and forth