Last Updated: June 10, 2020
·
1.652K
· alesguzik

Git: switch between last two branches

Just like cd - will change directory to last directory you visited, git checkout - will switch to branch you've been working on prior to current. Very useful if you often need to switch between master and feature-branch. - is a shortcut for @{-1}. You may use @{-N} syntax to checkout N-th last branch.

1 Response
Add your response

Ales, check out my easy aliases (recent branches and select a branch)to quickly switch between any number of branches.

over 1 year ago ·