We use git as source control.
To get started with git, follow the hands-on tutorials here.
You should also watch following video.
We use following branching startegy: git flow.
basicly to implement a new feature, you do the following:
- You make a new branch your-feature from the develop branch
git checkout -b **your-feature**
- You make your code changes in your feature branch
- Commit and push your changes in your feature branch
git commit -m "**your-message**"
git push origin **your-feature**
- Merge the develop branch back in your feature branch.
git merge develop
git push origin **your-feature**
- Squash merge your branch in the develop branch.
git checkout develop
git merge --squash **your-feature**
git commit -m "**your-message**"
git push origin develop
- We don't merge feature branches. We squash merge them (see obove). This keeps the git history on the develop branch very clean and tidy.
- We don't delete feature branches. Even after we completed the feature. This is because we squash merge. We still want to be able to see the exact history of a certain feature. We can find this in the git log of a feature branch.
- We avoid unnecessary merge commits. We do this by always doing git pull --rebase rather than git pull (see below).
- NEVER do a force push on develop, master, rc!
When you are working on the develop or Test branch, and you finished a feature/bugfix, but someone else already pushed a commit of their own, you won't be able to push your changes to the remote without first merging. To avoid this do the following:
git pull --rebase origin your_current_branch
git push origin your_current_branch