Branch Based Workflow for QGis

This workflow might be useful for you if:

  • you work on multiple features/bugs at a time
  • you do not have write permission at the qgis repository(you can only issue pull requests).

This workflow is strictly branch based. That is, you are never going to do any real work in master.

  1. Login to GitHub
  2. Fork the project at by clicking “Fork”. This may take a while
  3. Create a local folder and switch to it
  4. mkdir qgisdev
    cd qgisdevgit

  5. Create a working copy of the latest qgis source in this local folder
  6. git clone
  7. Now we tell git that this local repository belongs to the real qgis repository. We do this by specifying upstream.
  8. git remote add upstream
  9. Bring your master branch up to date with the latest changes in Qgis Repository.
    git checkout master
    git fetch upstream
    git rebase upstream/master
  10. Now Create a branch from master branch.
  11. git checkout -b myBranch
  12. Do you work modifying source code and commit often as you like.
  13. git commit -m "work started"
  14. Make more changes and follow-up with more git commits.
  15. A few days might have gone by since your creation of this branch. Now you want to make this branch up to date with the latest in server.
  16. git checkout master
    git fetch upstream
    git rebase upstream/master
  17. come back to your branch and update all changes from master to this branch
  18. git checkout myBranch
    git rebase master
  19. more commits(git commit -m “etc..”)
  20. now you see that you are ready to issue a pull request..
    update master again as we did previously and follow it by a rebase -i to format your commit comments.

    git rebase master -i
    git push origin myBranch

    now you can issue a pull request from github website.

  21. Some experienced devs would review your pull request and might ask you to change something. You just make the changes again
    in your branch followed by commits. Again update master and rebase with master.
    Update your pull request by pushing to your branch:

    git push origin myBranch

    Now the changes would be visible in your current pull request.

One comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s