Creating a Local Branch for an Issue - acquaman/acquaman GitHub Wiki

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 parent branch for your development: git branch
  • If you're not on your proper parent branch, then switch to it: git checkout parent, where parent is the current branch from which you wish to fork.
  • Ensure that there are no pending changes within your parent branch which may require committing: git status
  • Ensure that your local parent branch is synchronised with the remote version: git pull origin parent, where parent is the current 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.
  • Ensure 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 parent 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 parent 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.