Skip to content

Latest commit

 

History

History
43 lines (36 loc) · 1.8 KB

how-to-git.md

File metadata and controls

43 lines (36 loc) · 1.8 KB

How to Use git When Contributing to Our Projects

The goal is to fork and preserve the state of the project at the time that you forked it, while contributing development branches to the original/upstream project.

Keeping your forked/master in tact allows others to more easily work with your forked copy.

Here are the steps with links to documentation:

  1. Fork to your GitHub account
  2. Clone your forked copy onto your computer
  3. Set master project repo as the upstream for your cloned repo
  4. Create a new branch (don't develop on 'Master')
    $ git checkout -b <new-branch-name>
  5. Develop (remember to save often ;) )
  6. Commit to your development branch
    $ git commit -m "Briefly explain your contribution"
  7. Sync your copy with latest upstream copy (in case the project changed while you were developing)
    $ git fetch upstream
    $ git checkout master
    $ git merge upstream/master
    If upstream/master has new commits:
    $ git checkout <new-branch-name>
    $ git rebase master (resolve conflicts, if any)
  8. Push your new branch to your forked repo
    $ git push origin <new-branch-name>
  9. Create PR from GitHub w/out merging to your master

Git Resources

If you are new to git, read the book

Reference Manual

A very nice explanation of a typical fork and PR workflow