Last Updated: February 25, 2016
· twolfson

Checkout/Merge previous branch

Similarly to cd -, git checkout - and git merge - will checkout/merge the previous branch respectively.

For example, if you are in dev/new.modal and you run git checkout master. Then, git merge - will merge dev/new.modal to master.

3 Responses
Add your response


Thanks! I had no idea that would work. This will make merging and moving around branches much easier.

over 1 year ago ·

I must admit I didn't even know about cd - going to the last used directory; I'll definitely be using both.

over 1 year ago ·

Didn't know merge could be used with - as well. Super pro tip thanks Bro!

over 1 year ago ·