Skip to content

Instantly share code, notes, and snippets.

@cfvonner
Forked from webRat/git_commands
Created April 24, 2012 17:36
Show Gist options
  • Save cfvonner/2481842 to your computer and use it in GitHub Desktop.
Save cfvonner/2481842 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