Skip to content

Instantly share code, notes, and snippets.

@calebhearth
Created January 24, 2013 17:15
Show Gist options
  • Save calebhearth/4625280 to your computer and use it in GitHub Desktop.
Save calebhearth/4625280 to your computer and use it in GitHub Desktop.
Switch back and forth between directories and git branches, and even merge the last branch you were on, with hyphen!
~/
↪ cd code/project
project[master]/
↪ cd -
~/
↪ cd code/project
project[master]/
↪ git checkout -b feature-branch
project[feature-branch]/
↪ git checkout -
project[master]/
↪ git checkout -
project[feature-branch]/
↪ vim app/models/user.rb
project[feature-branch]/
↪ git commit -am "quick fix"
# of course there's a pull-request/code review here
project[feature-branch]/
↪ git rebase master
project[feature-branch]/
↪ git checkout master
project[master]/
↪ git merge -
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment