Skip to content

Creating a Local Branch for an Issue

iainworkman edited this page May 27, 2014 · 8 revisions

The first thing a team member should do when tackling an issue is to create a local branch which will contain all the changes required to solve it. Eventually, after being reasonably confident that the issue is resolved, the branch will be pushed to the remote so that it can be pulled to the beamline machine for testing. Once testing is sufficiently performed, the branch will be merged back into that team members particular master branch.

How to create a local branch for an issue

  • First, select an issue to be solved
  • Navigate to the Acquaman development folder: cd beamline/programming/acquaman
  • Ensure that you are on the current master branch for your development: git branch
  • If you're not on your master branch, then switch to it: git checkout Master, where Master is the current master branch from which you are working.
  • Ensure that there are no pending changes within your master branch which may require committing: git status
  • Ensure that your local master branch is synchronised with the remote version: git pull origin Master, where Master is the current master branch from which you are working.
  • Perform a clean build in QtCreator by right clicking the relevant project and selecting, clean, qmake then build.
  • Create a new local branch for your particular issue: git checkout -b Issue### where Issue### is the name of the issue you wish to work on.
  • Endure that you have been moved to the new branch you've created: git branch

You will now be able to make changes to the local branch, without altering any other code in any other branches.

Notes

The master branch for development for each particular team member is often different, and is not necessarily the actual repository 'master'.

If there are changes to be committed on the master before you branch you can run: git diff filepath where filepath is the path from the git folder to the file. This should give you information on what the pending change is.

If you wish to switch from one branch to another, ensure that all your changes are committed before switching.