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.
- Update “master” branch.
> git pull upstream master
- Create a new feature-branch “feature1”
> git branch feature1 master > git checkout feature1
- Do some work on your feature, add and commit it
> git add File1, File2 > git commit -m "Working my feature"
- 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"
- 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
- “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
- Push up to github
> git push origin feature1
- Issue pull request
- When processed, update “master” to pull down your official change, delete “feature1”
> git checkout master > git pull upstream > git branch -D feature1