Git Workflow

chribben edited this page Apr 22, 2012 · 1 revision

Git Workflow

If you're a developer who wants to work on the Documently source code and submit your changes for consideration to be merged into the master branch, here's how. Thanks to Diaspora for their workflow, which we've copied.

Quickfire Do's and Don't's

If you're familiar with git and GitHub, here's the short version of what you need to know. Once you fork and clone the Documently code:

  • Don't develop on the master branch. Always create a development branch specific to the feature you're working on. If you decide to work on another feature mid-stream, create a new branch for that feature--don't work on both in one branch.
  • Do not merge the upstream master with your development branch; rebase your branch on top of the upstream master.

Step-by-step

  1. Fork on GitHub (click Fork button)
  2. Clone to computer ($ git clone git@github.com:you/Documently.git)
  3. Don't forget to cd into your repo: ($ cd Documently/)
  4. Set up remote upstream ($ git remote add upstream git://github.com/haf/Documently.git)
  5. Create a branch for new feature ($ git checkout -b new-feature)
  6. Develop on feature branch. [Time passes, the main Documently repository accumulates new commits]
  7. Commit changes to feature branch. ($ git add . ; git commit -m 'commit message')
  8. Fetch upstream ($ git fetch upstream)
  9. Update local master ($ git checkout master; git pull upstream master)
  10. Repeat steps 6-8 till feature is complete
  11. Rebase featuer branch ($ git checkout new-feature; git rebase master)
  12. Push branch to GitHub ($ git push origin new-feature)
  13. Issue pull request (Click Pull Request button)