Skip to content

Git Cheatsheet

Colin Hart edited this page Feb 8, 2017 · 1 revision

#Cheatsheet

  1. $git branch
  • lists all available branches
  1. $git checkout <branch name>
  • moves from current branch to a different branch
  1. $git checkout -b <branch name>
  • creates a branch and switches from current branch to just created branch
  1. $git branch -d <branch name>
  • deletes the branch with that name locally
  1. $git merge <branch name>
  • takes the committed code in the branch you pass in and merges it into the branch you're currently in
  1. $git remote -v
  • lists all the remotes on your repo.
  1. $git remote add <remote name> <url>
  • add a new remote to your repo
  • remote name would be:
    • origin (your fork or your repo)
    • upstream (the place your forked from)
    • heroku (the heroku remote url when you run $heroku create)
  1. $git remote remove <remote name>
  • deletes the remote named