1. Install Xcode from the app store.
  2. Install Homebrew and its dependencies.
    $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
  3. Install a recent version of Git and CMake.
    $ brew install git cmake
  4. Upload your SSH key to Github
    1. Generate one if you haven’t already.
      $ ssh-keygen -t rsa -b 4096 -C "<email address>"
  5. Install a good .gitignore file.
    $ curl https://www.gitignore.io/api/objective-c >> ~/.gitignore
  6. Make sure git knows about it.
    $ git config --global core.excludesfile "~/.gitignore"
  7. Make sure Xcode removes trailing whitespace.
    $ defaults write com.apple.dt.Xcode DVTTextEditorTrimTrailingWhitespace 1
    $ defaults write com.apple.dt.Xcode DVTTextEditorTrimWhitespaceOnlyLines 1

    1. Fork
    2. Clone your fork
    3. Add main (real repository) as your upstream remote.

    git remote add upstream git@ghe.xxx.net:/iOS/xxx-ios.git

    4. Disable pushes to upstream, to minimise the risk for mistakes

    git remote set-url --push upstream no_push

    5. Make sure git pushes to your fork by default.

    git config remote.pushdefault origin

    6. Make sure git only pushes the current branch.

    git config --global push.default simple

    7. set your master branch’s remote to upstream.

    git fetch upstream
    git branch --set-upstream-to=upstream/master master

    8. Then work

    git checkout master
    git pull upstream master
    git checkout -b my-fix

    9. Push the changes to your fork.

    git add .
    git commit -m
    git push -u origin my-fix

    10. If merging a PR to upstream conflicts, merge master to your branch and update the PR.

    git fetch upstream master
    git merge upstream/master