Excuse the basic quesiton, but I’m new to bitbucket and xcode, with branches and master.
I have been working on a project on a branch, and now I have to merge the code from the branch to the master. In xcode, when I click "source code" then "push", it asks me which branch to push to. If I choose there "master" then push, is this in effect merging the branch to the master?
If not, how should I merge the branch to the master.
Thanks
3
Answers
Go to the Source control navigator (⌘2). All you repositories and branches are listed there. So you will be able to do the main operations on them using the contextual menu (Merge from Branch, Merge into Branch, Checkout, etc.).
First of all, check the
And , once you have completed development of the new feature (and of course tested everything) it needs to get merged back into the master branch. To do that you first need to switch back to the Master branch (using Xcode or from the command-line).
At this point, things get a little bit confusing with Xcode as to merge the changes you need to switch back to the Xcode project window. There does not seem to be any way to perform the merge from the Xcode Organizer window. With the project window selected you can access the File > Source Control > Merge menu option. I find this a little annoying that the branching and merging commands cannot all be performed from the Organizer. Anyway once you find the Merge command you should see a dialogue asking you to confirm which branch you want to merge back into the current (master) branch as you mentioned
If you are new to Bitbucket and Xcode, then you don’t do this based on a reply on Stackoverflow, because you can really, really mess up your repository.
Find someone who is knowledgable about Bitbucket and Xcode, who can sit besides you and watch what you do, and explain to you what to do and why. The usual method would be that you create a pull request and someone else merges it for you. That may be a bit of work for them, but fixing a bodged merge into master is ten times more work.