Git commit against tag with no branch

后端 未结 4 930
野性不改
野性不改 2021-01-30 04:00

If I check out a tagged version of my source code without creating a branch, Git indicates that I\'m not associated with any branch at all. It\'s happy to let me make changes an

4条回答
  •  伪装坚强ぢ
    2021-01-30 04:32

    To answer the second question you'd use git reset --hard yourtagname

    As for what would happen you essentially forked your branch at the tagname and stayed on the same branch. Your commits in the old fork are still there... they're just hard to see. You might have to use the reflog to find the old fork.

提交回复
热议问题