This repository has been archived by the owner on Jun 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Our Git workflow
raphael goujet edited this page Jan 29, 2014
·
5 revisions
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:
- 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
- Create a (local) feature branch
git checkout -b MY_BRANCH_NAME
- Work on that feature and commit to it
git commit -am "my commit message"
- Push that branch to GitHub
git push -u origin MY_BRANCH_NAME
- Go to GitHub and create a pull request
- If further commits are necessary, you can continue to commit and push that branch
- 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
- Drink a beer
To review changes:
- Switch to the remote branch
git fetch origin
git checkout MY_BRANCH_NAME
- 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.
- Compile
- Test the feature.
- Run regression tests ( see the regression tests guide)
- 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
- Deploy! (see the deployment guide)
- 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
(orgit clean -n
to see what will be removed first)
-
Tutorials:
Reference:
Development:
Problems: