Justin
Justin

Reputation: 45350

Making changes to a git tag and repushing

Can I go into a tag in git and make changes and repush that tag and new changes?

I tried:

 git tags
     0.2.0
     0.2.1

 git checkout 0.2.0

Then I made some changes and did:

 git add .
 git commit -a -m "Cleanup."
 git push --tags

But it is saying no changes to push.

Upvotes: 7

Views: 3657

Answers (1)

VonC
VonC

Reputation: 1324258

No, you should make a branch for that tag, make a commit in it, and push that branch.

git checkout -b branch0.2.0 0.2.0

A tag represents a commit, and cannot be changed or moved.

But nothing prevents you to make and publish (push) a branch dedicated to evolutions specific to that tag.


"no changes to push." means DETACHED HEAD, which is exactly what happen when you checkout a tag: you are no longer in a branch (with a HEAD for that branch).

Upvotes: 2

Related Questions