Skip to content

Instantly share code, notes, and snippets.

@NimbusBP1729
Last active October 13, 2015 22:28
Show Gist options
  • Save NimbusBP1729/4265379 to your computer and use it in GitHub Desktop.
Save NimbusBP1729/4265379 to your computer and use it in GitHub Desktop.
getting an up-to-date upstream:
git checkout master
git pull upstream master
git push origin master
making a new branch called 'new_branch_name':
git checkout master
git checkout -b new_branch_name
switching to an existing branch called 'some_branch_name':
git checkout some_branch_name
staging changes to a new branch:
>> to stage removal of a file named foo.txt:
git rm foo.txt
>> to stage addition of a file named foo.txt:
git add foo.txt
>> to stage addition of all new files:
git add .
to commit staged changes to a branch:
git commit -m "a helpful message"
getting an up-to-date branch:
git fetch <remote>
git checkout <remote>/<branch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment