MikeG MikeG - 1 month ago 5
Git Question

Is it possible to replace the master branch in Xcode with my current "feature branch"

I have been developing a feature for my app in Xcode. I use the

master-branch
as my stable/production-ready branch. When i work on a feature i start a
feature-branch
. This particular feature branch I have been using has had a lot of significant commits (30+ commits) and now when i try to merge it into my
master-branch
Xcode tells me there has been a conflict with various files and the merge is unable to be performed. There is no option to resolve the conflicts.

I am using Xcode 8.0. At this point the
feature-branch
is far ahead of the
master-branch
and is production ready. I would like to begin working on new features but i don't want to make a mess by creating more branches off of the current feature branch. The only thing I can think of is to just completely replace the
master-branch
with my
feature-branch
but is this even possible? If so then how?

I have been unable to find anything in Xcode, Apple documentation or on stack. Thanks for any advice!

Answer

What you should do here is merge your master-branch into your feature-branch. Fix your conflicts. Test, make sure it works. When you're convinced all is good, merge feature-branch back into master-branch.

During this time, you can still work in master-branch as needed. But keep in mind more conflicts could arise. And in that case, I'd also just do master-branch -> feature-branch -> master-branch where the "->" represents doing a merge.

For conflicts, I actually don't use Xcode to resolve, but there are numerous resources out there to indicate how to do this.

Comments