Why does creating new branches in Xcode9 always fail with "not a valid branch name"? - xcode

Whenever I try to create a new branch, it says: The name "MY-BRANCH-NAME" is not a valid branch name. I am adding the steps I performed while trying to create a new branch.
Why is this happening?
P.s.- There are no uncommitted changes and everything is pushed to github repository.

I have the same problem. Looks like an xcode bug.
xcode Version 9.0 beta 3 (9M174d)
I exited xcode, ran up sourcetree and created the new branch, loaded up xcode again and all appears fine.
I also replicated the issue with a brand new spritekit game project.
Raised a bug report with apple:
https://bugreport.apple.com/web/?problemID=33497210

Could be an issue with your git UI? are you able to get the command line working. simply type in: "git checkout -b new-branch-name" and it should work unless you include some illegal characters in there. The cause is more than likely a bug in the particular UI of git application that you are using.

Related

Open old version of Xcode project files stored in GitLab

I am trying to figure out how to open an old version of my Xcode project that is stored in GitLab. Usually, I use Xcode to push updates to Gitlab and on the occasions, I've had to get my project from GitLab, I simply click the "Open in Xcode" button on GitLab, which brings my project up.
The problem that I'm having now is that I've accidentally introduced a bug into the project that crashes the app and I can't figure out how to crush this bug. The last couple of updates to GitLab contain this bug so I need to revert to a copy a bit in the past. When I click on this update, there is no open in Xcode button, and I'm unsure about how to open this previous version.
I'm hoping that there is a straightforward solution to getting this old version of this file up. I'm just getting started using git, and I'm hoping someone on here can provide some insight.
Can someone please point me in the right direction on the easiest way to revert to an old project update on GitLab?
It seems easier to:
close XCode
cd /path/to/local/clone/of/GitLab/repo
switch to the command line and type git switch <old SHA1> in order to update the working tree with the files content of that past SHA1
open XCode back up.
(Note: git switch is better than the old legacy git checkout command)
If you want to commit some fixes, your git switch command will be:
git switch -c fix <old SHA1>
That will start a fix branch starting from <old SHA1>.

pulling an older version of a git repo to xcode

I am trying to get started editing an ios app that is stored on a bitbucket repo. The most recent version of the app crashes with a message:
[Crashlytics] Version 3.3.4 (82)
fatal error: unexpectedly found nil while unwrapping an Optional value
(lldb)
So, I am trying to pull an older version of the app.
I click "Check out an existing project" Then it prompts for me to enter the location of repository. I have no problem pulling and running the most recent version from the repo. Is there some way to specify that I do not want it to use the most recent version?
EDIT 1
The window I am working with looks almost exactly like this: http://www.techotopia.com/images/6/68/Xcode_6_add_git_repository_dialog.png
Do the Check Out first - just go ahead and check out the project repo. (You may already have done this.)
Now you have, on your computer, the whole repo, including earlier commits (versions) of the project. In other words, you didn't just check out; you cloned.
Now use Log View to find the commit you think will work.
Now check out that commit. You'll have to use the command line or Source Tree to do that; Xcode's weenie source control support won't help you with it.

XCode 5 does not show full SVN history for repo

XCode 5.0.1 on OSX 10.9 does not show the full revision history for my repository under Source Control/History.
What it does display is the history up to a certain point several months ago, but nothing newer than that.
I tried viewing the repo and its history in Versions and there it works just fine.
At some point we migrated the repo from one server to another. We also upgraded the repository a while back, but I don't know to which version of SVN. However, I do know that we have Visual SVN Server and SVN 1.8.0 serverside.
On the other hand, the XCode 5.0 release notes state that XCode uses SVN 1.7, which leads me to suspect that this could be the cause of my issue. However, I also seem to remember that XCode used to refuse to work with unsupported versions of SVN.
Any ideas what could be causing the problem?
What sucks, but is the default in Xcode is that the server status is not automatically updated.
Open the preferences and go to the Source Control Preference and make sure the "Refresh server status automatically" button is checked.
There is nothing I can find within the Xcode UI besides this that tells you the server history is current or how to refresh it.
This is verified as of Xcode 5.1.1. What a shitty UI. Really.
Cheers.
In my case sometimes begins work after "Source Control/Update".
Actually, its terrible bug, you have no guarantees that you see actual list!!!
To answer my own question, it appears that there was something wrong with the working copy. Deleting it and then doing another checkout directly from XCode fixed the problem.
Yet another variation on 'turn it off, then on again'.

XCode Won't Commit To GIT

Been googling for a while with no luck.
I have been working on my app for a week and I'm trying to commit to git now, so I can start branching and try some new stuff. But I can't commit my changes. I get the following message:
"The working copy "APP NAME" failed to commit files.
fatal: Could not switch to '/Users/Leonne/Documents/iOS Projects/APP NAME/APP NAME/Resources': No such file or directory"
I have initialized the git repository. I don't understand what could be going on.
Before, I did create a "Resources" folder, but deleted it afterwards. I never committed with the existence of this "Resources" folder. I deleted the Resources folder because it was giving me troubles whenever I tried to compile my app. I'm working with XCode 4.4.
Any help will be appreciated.
Ok, I just experienced this problem today morning. I don't know if mine is THE perfect fix. My Mac crashed and I restarted, and I could commit again.
If my fix hold true with you as well, then it could be a bug with XCode.
Edited
It seem my error still exists and the following is my fix.
It seem Xcode GUI have some problem with using GIT properly. So i used the terminal to do this. I went to the working directory and then did a git status this will show you a list of files that were deleted/modified/added. You can manually add them all together using git add or just a straight git commit -a (not recommended on complex projects)
This solved the commit issues and when i went to Xcode, the error doesn't seem to exists anymore
Looks like I have the bad habit of solving my hour-long problems 5 minutes after I post about them on StackOverflow, haha.
My fix was rather easy. I navigated to the specified route and re created the Resources folder. I added the folder to my project via XCode's "add files" feature. Directly afterwards I deleted it from there, moving it to trash. Now I can compile and commit, thank goodness.

xcode 4 not cooperating with git

I'm seeing some strange behavior with Xcode 4 and git.
Create a new project
Right click on files - choose source control then commit. Add a comment.
Choose source control then push from the file menu.
Xcode returns an error complaining about uncommitted changes?!?
Calling git status from the command line, I can see that some of the internal userdata files are not committed. Shouldn't Xcode know to either skip or include those? There is no indication in Xcode that there are any uncommitted files. The only way to find them is from the command line.
One thought would be to manually create a .gitignore file, but I would assume that Xcode handles all that internally.
Did I just stumble onto a bug, or is there some standard step that I'm missing?
Thanks!
Well, a bug is in the eyes of the beholder, isn't it. Yes, you need to Setup your git ignores for xcode.

Resources