How-to Git in GPIAG-Software
A nice introduction in version control with git is given by www.git-tower.com/learn/.
- Most important Git commands: Git Cheat Sheet
- Most important command line commands: Command Line Cheat Sheet
We use a Git branching model based on the idea of Vincent Driessen which is well-known as Git-flow. The general scheme of this branching model can be identified in the following diagram image from Vincent Driessen (Creative Commons BY-SA):
In principal git-flow is a naming convention for our branches:
|Feature Branch Prefix||feature/*|
|Hotfix Branch Prefix||hotfix/*|
|Release Branch Prefix||release/*|
Create a new feature
Lets say you want to add a new feature called YOURFEATURE to the code.
First, you have to create a new branch called feature/YOURFEATURE, you can do this in your local repository by
git checkout -b feature/YOURFEATURE
Now you are ready to develop your feature and add commits as you like. Once the feature is ready, it has to be merged into develop. This can be done by e.g.:
git checkout develop git pull origin develop git merge --no-ff feature/YOURFEATURE # You may have to clear some merge conflicts at this point git push origin develop # If you do not have rights to push into develop directly open a merge request.
Make sure you set the --no-ff tag when you merge your feature into develop. The non fast-forward merge allows to easily revert a single feature, if necessary. The effect of --no-ff is described in detail here.
Create a new release
- Update manual in the wiki