Search code examples
gitgithubgit-svn

How can I commit to an old git tag?


So two months ago I migrated our codebase in SVN into Git with the complete changeset history. Immediately after that, we tagged a new release and continued working. So while we've continued working in the new tag, some people have continued fixing bugs in the old tag in SVN and now I'd like to pull all those changes into that tag in Git.

I can clone the tag and make Git will let me make commits into it, but I can't push anything back up with git-push. Checking git-log, the commit is there but git-st tells me that I'm not currently on any branch.

So Internet, how can I commit to an old git tag?


Solution

  • Tags are not movable. Once you have created a tag that points to a particular commit, you cannot change that tag later.

    It sounds like you meant to create a branch instead. You should create a new branch (git branch branchname && git checkout branchname) to make sure you don't lose your commits. Then push that branch to the repository and have your release/bugfixing developers work in that branch for the release.