Skip to content

Working with git

Daniel Martin edited this page Feb 14, 2017 · 1 revision

If you're a developer who wants to work on the Dradis source code and submit your changes for consideration to be merged into the master branch, here's how. Thanks to Disapora for their Git Workflow page which inspired (and completes) ours.

If you're not familiar with Git

Maybe this will help:

http://eagain.net/articles/git-for-computer-scientists/

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 Dradis code:

  • Don't develop on the master branch. Always create a development branch specific to the issue you're working on. Name it by issue # and description. For example, if you're working on Issue #26, a Skipfish import plugin, your development branch should be called 26-skipfish-plugin. If you decide to work on another issue mid-stream, create a new branch for that issue—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.

  • A single development branch should represent changes related to a single issue. If you decide to work on another issue, create another branch.

Step-by-step (the short version)

  1. Fork on GitHub (click Fork button)
  2. Clone to computer ($ git clone git@github.com:you/dradisframework.git )
  3. Don't forget to cd into your repo: ($ cd dradisframework/ )
  4. Set up remote upstream ($ git remote add upstream git://github.com/dradis/dradisframework.git)
  5. Create a branch for new issue ($ git checkout -b 100-new-feature, if you don't have a bug report no worries just skip the number)
  6. Develop on issue branch. [Time passes, the main Dradis repository accumulates new commits]
  7. Commit changes to issue 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 5-8 till dev is complete
  11. Rebase issue branch ($ git checkout 100-new-feature; git rebase master)
  12. Push branch to GitHub ($ git push origin 100-new-feature)
  13. Review our Contributor's Agreement. Sending us a pull request means you have read and accept to this agreement
  14. Issue pull request (Click Pull Request button)

Step-by-step (the long version)

There is no point in duplicating here when the original page has a very detailed guide that will walk you through the process (just remember to use https://github.com/dradis/dradisframework/).

Find the 'Step-by-step (the long version)' section in: https://github.com/diaspora/diaspora/wiki/Git-Workflow