Skip to content

Instantly share code, notes, and snippets.

@soundyogi
Last active June 6, 2017 18:00
Show Gist options
  • Save soundyogi/e3449b71282d4b14206b to your computer and use it in GitHub Desktop.
Save soundyogi/e3449b71282d4b14206b to your computer and use it in GitHub Desktop.
Git Cheat Sheet
// git cheatsheet for newbies
// init a new repo
git init
// add a "remote" with a name and repo url
git remote add "remoteName" "url"
// add all changes
git add -A
// commit changes to staging
git commit -m "comment"
// push changes to repo
git push "remoteName" "branch"
// pull changes
git pull "remoteName" "branch"
// show all branches
git branch -a
// show only remote branches
git branch -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment