Quickly switch between Git branches
With Bash, it's possible to quickly switch between two paths using the cd -
command, e.g.:
~/foo $ cd ../bar
~/bar $ cd -
~/foo $ cd -
~/bar $
The git checkout
command works the same:
$ git co master # checkout master
$ git co -b foo_branch # checkout foo_branch
$ git co - # checkout master again
$ git co - # checkout foo_branch again
$
Written by Baptiste Fontaine
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#