Category Archives: Git

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git is easy to learn and has a tiny footprint with lightning fast performance. It outclasses SCM tools like Subversion, CVS, Perforce, and ClearCase with features like cheap local branching, convenient staging areas, and multiple workflows.

How to tag a version.

It is a good idea to add tags to specific commits.

Tag overview

git tag     : show all tags

Add an annotated tags: recommended

Annotated tags are stored as full objects in the Git database. Containing the tagger name, email, date, have a tagging message.

git tag -a v3.1.0 -m "Release 3.1.0"            : add an annotated tag to current commit with message
git tag -a v3.1.0 -m "Release 3.1.0" SHA        : add an annotated tag to a commit with SHA and add message

Adding a simple tag: not recommended

A simple tag is very much like a branch, but it doesn’t change location and is fixed to one commit.

git tag v3.01          : add a simple tag to current commit
git tag v3.01 SHA       : add a simple tag to commit with SHA

It is recommended to use the “-a” option for annotated tags.

Push a tag

By default, the git push command doesn’t transfer tags to remote servers. You will have to explicitly push tags to a shared server.

git push origin <tagname>
git push origin v3.1.0

How to keep the development branch clean?

Use case: The work is finished on the feature branch and needs to be checked into the development branch.

Default: Git performs a fast-forward merge by default. 

Result: A fast forward clutters the development branch and loses the overview on the work done in the feature branch.

Advise: The –no-ff flag causes the merge to always create a new commit object, even if the merge could be performed with a fast-forward. This groups all historical commits that belong to a feature branch and keeps the development branch clean.

More info at: