Menu

Git

We use a simple branching model. The main branch (master) represents the code that will be in the next feature release (x.y). When released, the last commit is tagged. A branch is created for the feature release (named x.y), and it collects the bug fixes for the bug fix releases (x.y.1, x.y.2, etc). Meanwhile, the master collects new features for the next feature release.

Setup projects

When fixing a bug, make sure that all PCRaster project have their release branches checked out.

Git

Create a new branch:

# Release branch.
# Make sure commit with tag 4.0.0 is checked out.
# A release branch only needs to be created once.
git checkout -b 4.0 <commit_with_tag_4.0.0>

# Bug-fix branch.
# Make sure release branch is checked out.
# Create a bug-fix branch for each bug.
git branch bug/sf605

Push a branch to server, setup branch tracking:

git push -u origin bug/sf605

Checkout branch:

git checkout bug/sf605

Rebase bug fix branches, at least once, before merging into the feature branch.
git rebase 4.0

DON'T merge with conflicts. Handle conflicts upon rebasing.

Visualize commit, merge, branch history of current branch. You may want to grep for specific tags.

git log --oneline --decorate --graph

Merge a bug-fix branch with the release branch, This assumes the release branch is checked out.

git merge --no-ff bug/sf605

Tag:

# Tag a project (annotated tag):
git tag -a v2.0.1 -m"Blahdiblah"

# Tag a PCRaster version (lightweight tag):
git tag pcraster-4.0.1

# Push the tags:
git push origin v2.0.1
git push origin pcraster-4.0.1

Related

Wiki: Home

MongoDB Logo MongoDB