Xcode. Scheme is missing on one branch - xcode

I've run into one thing I've never seen before. Throughout this week I've worked with several branches in my project and they all have been committed and pushed to the origin and now, when I'm home I decided to work for a while. But when I switch to one of those branches the scheme to run the app is missing. Only CocoaPods schemes available. This is how it looks:
It's only on one particular branch. When I switch to another branch then it's ok, this scheme is present and I can run the app successfully. What's that? How to fix it?

Related

Pulling a branch into xcode gets the files but not the changes to add them to project itself

I'm going up to a cottage for a couple of days and would like to work on one of my pet projects. I'll be using my wife's MBA so I'm trying to pull the latest branch from GitHub.
On GitHub there are two branches, master and the current branch, glib-remove. The main difference in the latter is the addition of two new files, data.h and data.c and changes to the Xcode project file to add them.
When I pulled the branch to the MBA I was mystified, as the files did not appear in the project. It turns it they were pulled, but the project file doesn't have them included. I'm a bit of a loss why this might be. The project is listed as clean on the original machine, it's definitely in the repo, but doing a pull on that file on the MBA does nothing.
Can someone suggest why this might be happening? It's easy enough to simply add the files to the project manually, but I'd like to know what's going on so I can avoid it in the future.

Xcode 12.1 Source Control not showing all branches

In Xcode I can branch from master and push just fine. The new branch appears in Gitlab as one would expect.
When I use Xcode to clone the repo into a location, it asks me which branch to clone which seems fair. What I am confused about is that I can only see the cloned branch, not the other ones. If someone else (or I on another machine) create a branch, it won't update that addition on the other Xcode.
I know how to navigate branches via git in Terminal but then I don't understand why Xcode has the Branches entry to begin with. I can merge via Terminal but I thought the whole point of Xcode Source Control is to have a UI for visualizing conflicts etc.
Am I missing something or is this working normally for everyone else?
Ok I found it: https://stackoverflow.com/a/54921527/2161301
When you expand Remotes and origin you will find the other branches too. So the "top level" Branches entry seems to be exclusively for local ones.

Work on two branches of the same repository at once

I recently started working on a different branch of my repository, but I noticed that I had not merged my work from an earlier branch yet. I figured I could copy and paste the missing pieces over from one branch to the other but I'm not sure if I can open them in parallel in two separate instances of Visual Studio.
I believe you can still merge your previous branch into the one you are working on?
If you really really need to have both versions open at the same time, you could clone the same repository into another, seperate, folder and have the previous branch there and open that version of the project.

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!
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.
I had a similar situation, but Source Control in Xcode wouldn't let me merge branches due to "tree conflicts". It just hung. Good thing I had a backup, cause I could no longer open the project.
After restoring the project from my backup, I did the following to replace the Master branch with my Development branch.
In Xcode I went to Source Control-> Working Copies and selected my Development branch as the working copy.
Under Source Control, I did a Commit for all my pending changes
In Source Control in the Working Copies section, I hovered over the the Development branch to expand the menu to the right and selected Configure project name
At the top of the Configure window, I selected Branches
I selected the Master branch and clicked on the - sign at the bottom and confirmed that I wanted to delete it.
Went back to Source Control, hovered over the Development branch in the Working Copies section and selected New Branch from the menu that expanded to the right.
Named the new branch "Master". This made Master the current branch.
When back to Source Control and changed the current branch back to my Development branch.

How to merge 2 branch in XCode?

We are two developer and we want to work on a same project at the same time. So, we use GitHub. However, we couldn't do this.
This is our problem;
I am pushing new xcode project to our master, then, my friend are pulling this xcode project. Every thing is ok since here. Then, I am changing some codes, then, I am pushing (commit and push) it again. When my friend change some codes (he didn't pull) and push it, there is an error like this: "The local repository is out of date. Make sure all changes have been pulled from the remote repository and try again."
Actually, we want that, we change some come codes, then, I and my friend push it, then these two file will be merged. How can we do this?
he will need to do git pull --rebase which will pull the branch and put his changes on top of yours
you should really branch each feature though and work on the conflicts during merge

Resources