5

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.

Justin
  • 42,716
  • 77
  • 201
  • 296

1 Answers1

1

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

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250