Github Workflow

Excerpted from Advanced Git Topics:

This is our default workflow. The central concept of this workflow is that all development occurs in isolated "topic" branches. The "master" branch is kept clean allowing easy branching to address separate features (topics) and bug fixes. Another key feature of this flow is the use of rebases instead of merges to prevent local merge commits.

  1. Update “master” branch.
    > git pull upstream master
    
  2. Create a new feature-branch “feature1”
    > git branch feature1 master
    > git checkout feature1
    
  3. Do some work on your feature, add and commit it
    > git add File1, File2
    > git commit -m "Working my feature"
    
  4. OPTIONAL: When you’re ready to push up, squash all of your commits together first
    > git reset --soft master
    > git commit -m "unified feature commit"
    
  5. When you’re ready to push your work up to get pulled in, make sure you’re up-to-date first
    > git checkout master
    > git pull upstream master
    
  6. “master” is now up-to-date. Switch back to your branch and rebase your work on top of the new “master”
    > git checkout feature1
    > git rebase master
    
  7. Push up to github
    > git push origin feature1
    
  8. Issue pull request
  9. When processed, update “master” to pull down your official change, delete “feature1”
    > git checkout master
    > git pull upstream
    > git branch -D feature1