Does anyone know if its possible to copy a VCS Root in TeamCity? The normal trick of going into the edit page and dropping down the Actions combo doesn't work, only has Move as an option.
The only approach I found was to create a project, attach the VCS root to the project, then edit it from the project "apply only for (a copy will be created)", then move the result to the root again.
Note that you have to be at build level in order to do this. You cannot do it from any place higher up the hierarchy, or the "apply only for..." option will not be shown.
If you have console access to the TeamCity server then cloning a VCS Root can be as easy as duplicating one of the config files:
cd /path/to/config/projects/MyProject/vcsRoots
cp -a MyVcsRoot.xml MyVcsRoot2.xml
Following that I would also quickly edit the <name>
tag in the copied file to make it appear with a distinct name in the web UI where you can edit the new VCS Root.
It goes without saying that this isn't a supported way of doing things but it's great if you're in a bind. (Successfully tested on TeamCity 8.1.)
You are correct, there is no action that I can find to copy a VCS Root, but the question is why do you want to copy it. If you have several entities sharing a VCS Root, and want to make some changes that would affect only one of those, Teamcity has you covered: just go to the entity, select to edit the common VCS Root, and when you want to save, just over the 'Save' button, Teamcity offers two radio buttons:
- Apply to [current entity] only (a copy of this VCS root will be created)
- Apply to all build configurations and templates
Then you can just pick the first option, and a copy with the changes is created on the fly.
© 2022 - 2024 — McMap. All rights reserved.