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.
Written by Ales Guzik
Related protips
1 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
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Git
Authors
khasinski
591.1K
dmichaelavila
500.4K
Related Tags
#git
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#