Skip to content

Instantly share code, notes, and snippets.

@wtarr
Last active December 10, 2015 23:38
Show Gist options
  • Save wtarr/4510579 to your computer and use it in GitHub Desktop.
Save wtarr/4510579 to your computer and use it in GitHub Desktop.
Git commands
#add a file
git add Transform.cs
#show list of branches
git branch
#create a branch
git branch mynewbranch
#switch to that branch
git checkout mynewbranch
#commit a change
git commit -a -m "comment for changes made"
#undo pending changes
git stash save --keep-index
git stash drop
#delete unversioned files
git clean -df
#check out an old state
git check -b previousstate 45frfef...ect
#resolve a binary conflict
git checkout --ours -- path/to/file
#or
git checkout --theirs -- path/to/file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment