- Home /
Unity Cloud Build: Using git branches in Source Tree
I've used Git + BitBucket + Source Tree with Unity for quite some time and I really like it!
I'm trying out Unity Cloud Build. It works fine as long as I'm only using the master branch.
However I really want to try out having a separate branch for cloud builds, so I (and my teammembers) don't build every time we commit. But I don't know that much about branching.
I've tried to setup a branch in Source Tree, like this:
In the web interface of Unity Cloud Build, I have changed the branch: Source Control -> Branch: UnityCloudBuild
But the Unity-Cloud-Build-bot doesn't seem to notice it, when I try to push to both the master branch and the UnityCloudBuild branch like this:
Am I doing something wrong branch-wise in Source Tree? Or what exact steps do I have to do from Source Tree, to push to the UnityCloudBuild branch, so that Unity-Cloud-Build-bot registres it?
Any help and resources are most welcome! Thanx in advance!
Can you checkout the repository in a different location and change to the UnityCloudBuild branch? Does it include all your changes? If that works properly it should also acknowledge the branch in UCB.
When you try to build the project in UCB with your UnityCloudBuild branch, does it fail? What does the extended log say?
Excellent suggestions! I've now cloned the project (from the UnityCloudBuild branch) on another location, and you were right, it didn't get any of the commits (even though I pushed to both):
So I think I need to commit / push (/merge?) differently from what I am doing now in Source Tree? Can anyone help me on that one?
Thanks in advance!
Did you commit your changes first, and then pushed the changes successfully to the branch?
I think you are still on your master branch and have committed the changes only to the master branch. In your image you see the Branches and the master branch is highlighted.
When you checkout the UnityCloudBuild branch you need to commit the changes too. It's not possible to push the changes to more than one branch (the one you work on) So in this case you would need to merge the master branch with your Cloud Build Branch.
In this case you would checkout your Cloud Build Branch (highlighted) and then if you right click onto the master branch you get a $$anonymous$$erge $$anonymous$$aster into Cloud Build. But there is documentation on the web on how to do proper branching.
I hope that makes sense?
Glad it works! No worries, that's not a big deal, you might be able to like comments too if they are helpful so others see what's useful at a glance! :-)
Answer by DustyScreen · Jul 22, 2015 at 07:08 AM
Here is how I got it working:
Commit and push all changes in the master branch
Change branch to UnityCloudBuild branch by double-clicking it in the left-site panel (so UnityCloudBuild turns bold)
Click the Merge-button in the top menu
Select the upmost commit (so the line turns blue) and press the OK-button in the bottom
Push the changes (that is, click the Push-button in the top menu, and OK in the following dialogue box)
Change branch back to master branch by double-clicking it in the left-site panel (so master turns bold again)
Make a cup of coffee and enjoy the fresh cloud build of your fantastic game!
Your answer
Follow this Question
Related Questions
Cannot Build with Unity Cloud Build 1 Answer
Behaviour is missing when using project on different computer. 1 Answer
Git submodule error in Unity 0 Answers
Downloading files with Git 0 Answers
How to best store default SceneManager setup in git repo? 0 Answers