Skip to content

Instantly share code, notes, and snippets.

@fritzvd
Last active December 14, 2015 14:18
Show Gist options
  • Save fritzvd/5099418 to your computer and use it in GitHub Desktop.
Save fritzvd/5099418 to your computer and use it in GitHub Desktop.
Git workflows

Git for Directors

I started editing a file and forgot to switch branch

git checkout -b forgottoswitch

All modified files are now available in the new branch forgottoswitch

I made changes but want to switch to a branch without committing my changes. Although I might want to go back to changes

git stash

Changes are now available in a stash. Enter git stash help to see extra commands. e.g switch to a branch with the stashed items:

git stash branch actually_do_want_a_new_branch

I made a local branch but I want to have it available on github

git push origin forgottoswitch

After pushing a branch to github don't forget to click on the pull request button in the github webclient

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment