jordan.baucke
jordan.baucke

Reputation: 4328

Github commit to tag for version control

We have a Github repo with a single branch 'master' representing stable versions of our code-base.

I want to be able to commit with 'tags' on specific commits that represent 'version' numbers as I've seen people doing.

We use 'SmartGit' to interact with the system, so when I create a new 'Tag' in the local version, I use 'Push Advanced' to create a new tag on the server.

However, none of the commit notes representing my specific changes to a tag are being displayed, and I'm worried that I'm not correctly committing to a specific 'tag' and don't want to overwrite the 'master' branch with a commit of a bugfix in an older version of the code (earlier version).

Anyone done this sort of staggered version control with tags in Github/SmartGit

gitup/smartgit with tagging

Upvotes: 1

Views: 2119

Answers (2)

Jakub Narębski
Jakub Narębski

Reputation: 323454

Tags are meant as human readable pointer to some specific version of a project; therefore they are immutable. You cannot create commit "on tag" -- Git won't allow it.

What you can do is to create maintenance branch for a given tag, and work on that. For example if you tagged last stable release with v1.3, you can create v1.3.x branch for maintenance (bugfixes) only; you would create there v1.3.1 tags etc.

Upvotes: 1

VonC
VonC

Reputation: 1323973

I want to be able to commit with 'tags' on specific commits none of the commit notes representing my specific changes to a tag are being displayed

You can put a tag on a (one) specific commit, but you cannot make "commits" to a tag.
You correctly push through the advanced options of SmartGit that tag to the remote.

But be wary of what commit SmartGit is able to tag: according to its documentation, it only tags the current commit.
That means you have to checkout said commmit first, before tagging it.

Upvotes: 3

Related Questions