Git: How to handle the issue that projects return to the wrong target branch
Introduction
This article explains an issue caused by projects having been pushed to the wrong target branch in the repository when they have been completed in XTM Cloud.
Changing branch after project is created
Once the project has been created in XTM Cloud, you might want to change the target branch in the UI, hoping that target files will be returned to that specific branch upon project delivery [XTM Connect → Buckets → Git → (select bucket) → General settings → Branch]:
However, this is not the case. The project will still return to the original target branch. This is because branches are not editable once the project has been created. If you want to change the target branch at this point, it is possible to do so but only in the back-end. There is a special table in the database that is not accessible through the XTM Cloud UI, in which a particular value needs to be changed. The value in this column is present from the creation of the task and never changes on its own.
For this purpose, create a ticket to the XTM International Support team and provide details about the issue, to have it resolved for you.
Once you get confirmation that the relevant change has been made, you can reopen a specific project and finish it again so that target files will return to the required branch.
Changing branch while project is awaiting creation
Once the repoconnector detects new content in the repository the project is awaiting creation (in accordance with the project creation time setup). At this point, the project itself is not yet available in the XTM Cloud UI, but its corresponding task has already been created and the Status column contains the value Synchronized in the UI [XTM Connect → Tasks]:
If we now try to change the target branch, the project will still return to the original one, upon delivery. The situation is the same as for the project that has already been created, and the resolution process is the same too. The XTM International Support team changes the value in the database manually. You can then reopen the project and finish it again.