Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making changes to a git tag and repushing

Tags:

git

git-tag

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.

like image 563
Justin Avatar asked Nov 13 '22 01:11

Justin


1 Answers

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).

like image 146
VonC Avatar answered Nov 15 '22 05:11

VonC