If we delete code from our trunk, will it delete it from all other branches and tags?

We are removing some integrations from our web application. We made a large investment in the integration code and may use it again in the future, but for now we don't want it in our code base.

We currently use SVN for version control. We have created a tag from our trunk containing the integration code and we are ready to extract all the hooks from our trunk.

If we delete files from our trunk or a branch derived from it, will it also delete it from our tag we created and other tags / branches? Or will the code remain in those other tags and branches?

1 answer

  • answered 2018-01-12 18:41 Chris

    No, it won't delete anything out of the tags/branches. The thing about tags/branches (aside from the fact that they are the same thing) is that they point to specific revisions in the repository. That's all they are. Whenever you add files to a repository, the file is there forever, because it's in the revision history. It doesn't matter if you delete the file from the working copy, that file will always exist in the repository.

    It's worth noting that if you ever re-instate these files in the future, you won't be able to reintegrate code from the branches to the trunk (automatically at least). You will more than likely get tree conflicts trying to do that automatically.

    Short answer, yes, the code will remain in the tags and branches.