Skip to content

Instantly share code, notes, and snippets.

@webRat
Created June 23, 2011 02:38
Show Gist options
  • Save webRat/1041777 to your computer and use it in GitHub Desktop.
Save webRat/1041777 to your computer and use it in GitHub Desktop.
9 Common Git Commands
git init - navigate to the appropriate directory and just type that.
git add . - adds everything in that path
git commit -m 'stuff' - Commits with the message 'stuff'
git branch - views branches
git checkout -b <new branch> - Creates & switches to new branch
git checkout <branch> - switches to branch
git merge <branch> - merges that branch to the existing branch that you're already in.
git branch -d <branch> - deletes branch
git push - This assumes you already have a remote setup (like github)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment