Skip to content
This repository has been archived by the owner on Jun 18, 2021. It is now read-only.

Our Git workflow

raphael goujet edited this page Jan 29, 2014 · 5 revisions

Our Git workflow

We follow a continuous-deployment process, based on the GitHub Flow. All development, new features as well as bug fixes, are done in separate branches (called "feature branches" below), and merged into the master branch via pull request on GitHub.

There are at least 2 parties involved in the process, the one who proposes changes and the one who reviews them.

To propose changes:

  1. Clone the repository (requires you to fork it first, if you do not have direct push access)
  • git clone https://github.com/CyberCRI/RedWire.git
  1. Create a (local) feature branch
  • git checkout -b MY_BRANCH_NAME
  1. Work on that feature and commit to it
  • git commit -am "my commit message"
  1. Push that branch to GitHub
  • git push -u origin MY_BRANCH_NAME
  1. Go to GitHub and create a pull request
  2. If further commits are necessary, you can continue to commit and push that branch
  3. Once the pull request is accepted, delete the local branch, as well as the reference to the remote one.
  • git checkout master
  • git branch -d MY_BRANCH_NAME
  1. Drink a beer

To review changes:

  1. Switch to the remote branch
  • git fetch origin
  • git checkout MY_BRANCH_NAME
  1. Perform a code review (see the code review guide). Any comments should be put into the pull request. Changes can be pushed to the feature branch.
  2. Compile
  3. Test the feature.
  4. Run regression tests ( see the regression tests guide)
  5. If all is well, accept the pull request and delete the remote branch.
  • Depending on the changes, GitHub may be able to merge automatically. If not, you need to do it yourself:
    • git checkout master
    • git merge MY_BRANCH_NAME
    • git push origin master
  1. Deploy! (see the deployment guide)
  2. Drink 2 beers

Some other common commands:

  • To return your branch to the version online (possibly losing local commits)
    • git reset --hard origin/master
  • To list remote branches:
    • git branch -r
  • To remove untracked (but not ignored) files, like after a merge:
    • git clean -f (or git clean -n to see what will be removed first)