Skip to content

Instantly share code, notes, and snippets.

@orhanobut
Forked from corbett/git best practices.md
Last active August 29, 2015 14:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save orhanobut/0e7622ad4f39f2fe833f to your computer and use it in GitHub Desktop.
Save orhanobut/0e7622ad4f39f2fe833f to your computer and use it in GitHub Desktop.

#to get started with dev -create a fork of the Signal-iOS repo https://github.com/WhisperSystems/Signal-iOS (click fork)

-clone that repo into a nice local directory

-add the original repository as a remote git remote add upstream https://github.com/WhisperSystems/Signal-iOS.git

-clone your fork and when you are ready to work on a new feature off of the master branch:

git fetch upstream
git checkout upstream/master 
git checkout -b my_feature
git commit -am "my changes 1"
git commit -am "my changes 2"
git commit -am "my changes 3"

you can also push to your fork git push origin my_fork

when you are ready to PR (one PR per feature):

  • rebase your changes into a single (or few) commits:
git rebase -i HEAD~3
  • rebase your changes on top of master:
git fetch upstream
git rebase upstream/master
  • push to your fork (if you rebased since pushing to your fork you will need to create a new branch)
git checkout -b my_feature_PR
git push origin my_feature_PR

submit your PR!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment