xcode git pull/push crash - xcode

When using the xCode IDE when selecting file -> Source Control -> Pull or Push xCode crashes. The only workaround so far found for this is to load the organiser and select each repository and click pull then when then repository name displays cancel the dialog. After repeating this for each repository the normal push/pull options work fine until Xcode is restarted and then the process must be repeated.
This happens the same on all machines (4) at our office. The repositories are on github and there are multiple repositories being loaded in for each project.
We having been using the work around for some time but as we get more repositories this becomes more of an annoyance. Any suggestions welcomed.

I had the same issues with Xcode 4.3 so I have been using Xcode 4.4 and 4.5 for development (I'm not close the delivering yet, so it doesn't matter than I cannot submit my App using these versions yet).
An alternative would be to use an external source control tool; I would recommend SourceTree as it's free and works well. Other than that, there is always the command line.

Related

For development in Xcode 10.x, how well does the git integration work with github?

Since Apple has pulled subversion integration from Xcode (and Perforce never choose to directly support that integration since Xcode 3), it seems as if git is the only fully integrated source code control system for MacOS and IOS development.
How well does Xcode 10.x integration work with GitHub?
In addition to Xcode's integration, what are some polished MacOS apps that serve as stand-alone git clients?
My experience with the git command line has not been great: I'm always getting into trouble where the repository gets messed up ("detached heads", for example) and it seems to take someone with a PhD in git to get me back to a functional, stable repository. Will GitHub help in those situations?
Xcode 10 integration with git is very intuitive and reliable. You can use Xcode for commit, push and see history of commits and so forth. Also Github macOS application works fine but I personally prefer Xcode to do so.
Using Xcode 10.2.1 with git and GitHub, brought me many troubles. I lost one day of development, because even though committing seemed fine inside Xcode, no commit was performed on the local .git repository nor on the remote Github repository.
The only way to recover a proper functionality was to checkout to the last committed version and loose all the job in between.
I have not been able to figure out the exact cause, but I noticed that opening several projects in Xcode and/or using playgrounds while developing on a project seems to corrupt Xcode git functionality. Quitting and relaunching Xcode corrects the trouble, most of the time ...

How to set Xcode Bot to run "on commit" for all branches of remote repository?

When creating an Xcode Bot in Xcode 6, it is linked to the current active branch in Xcode source control. There seems to be no supported way to change branches after creating the bot.
Xcode Service: Select Git Branch
I have set my bot to run "on commit". I find when I commit to that branch the bot immediately integrates the project. But when I commit to a different branch, the bot takes no action.
Ideally I would like a single Xcode Bot to look at all branches of the remote repository. When there is a new commit to any branch the bot and its tests should be run.
I do not want to create a new bot for each branch. Is there a solution?
Bug Report:
rdar://20154198
Developer Forum:
https://devforums.apple.com/thread/263490
There is also https://github.com/modcloth-labs/XBotBuilder developed by the same creators of the tool #jeremy-fox. It will create a bot per Pull Request, and re-run the bot for every addition in the PR.
It seems to be in early stages and without documentation but the code seems to be well organized so wouldn't be hard to get it to work or change it's behavior to do what you want.
For the moment we use a tool called Buildasaur (https://github.com/czechboy0/Buildasaur) to improve our CI-workflow. It's written in swift and helps to build/run/ delete bots automatically for one github repository, for example whenever a pullrequest was created or newer commits were pushed to the pullrequest. Actually it works fine on our Xcode Server 6.3. Unfortunately it works for just one repository at the same time. :-(
We also hope, that Apple will implement such features soon.
Apple response from the dev forum:
This isn't something Xcode Server supports. You might be able to craft a pre-integration trigger to switch branches in the working copy and invoke seperate xcodebuild invocations, but the results reported in the UI will only be for the Xcode Server builds (the build that XCS runs after your trigger executes).
https://devforums.apple.com/thread/263490
rdar://20154198
This is not currently possible with Xcode Bots (current versions are Xcode Server 4.0.3 & Xcode 6.2). A Bot will only track the specific branch form which it was created.
This was possible in the past on Xcode Server 3 and Xcode 5 using https://github.com/modcloth-labs/github-xcode-bot-builder but this project hasn't been updated to work with the latest version of Xcode Server and Xcode.
I'm also really hoping Apple introduces this feature soon, it would be great to be able to have a single bot monitoring a repo for new Pull Requests and when found run an integration against that PR. For now though, it's just not possible.
Update 3/19/2015:
As #Gus reports in another answer, there is a new Mac OS X based project that can help with ad hoc bot creation for feature branches/PR's called XBotBuilder - https://github.com/modcloth-labs/XBotBuilder. It should be worth noting that currently, this project only works with one github repo. So, if you have more than one repo you'd like to monitor for PR's, this is still not currently possible unless you have multiple machines each running a different instance of XBotBuilder and targeting a different repo.

How to save versions of the project in Xcode 5

I'm new here.
I created a project and edited it few times. to back up I made a copy of the project folder. I see that in the Xcode 5 appears Source Control and I try to use it for my project versions back up. I selected from the menu: Source Control > Check Out - and entered a Repository Location => it created an empty project (with my project name). How can I save versions of a project?
I recommend not relying on xcode's built-in version control.
Try out http://github.com
For local use the building Git is good, commit often.
See, the Apple WWDC-13 session 414 (Understanding Source Control in Xcode) for more information.
For secure off-sit setup a remote repository, GitHub is the most popular but not free for private repos. Bitbucket is free for limited private repositories and is easy to use.

Using both Xcode and Terminal for git commands

I am new to using git and I followed some instructions for using it directly form the terminal. I noticed when I opened the project that Xcode also showed this repository clearly, even though it was an existing project and Xcode did not itself create the repository (I didn't have that option checked when the project was created).
I read on this question that Xcode keeps its repositories separate from the repository created using git manually from terminal. Yet, my experience suggests Xcode is in fact finding it fine.
My questions are simply:
Does it matter from the sake of functionality whether the repository is created with Xcode or manually from the terminal?
Can the two be used interchangeably on the same project? Will the same repository be used?
Is perhaps the latest Xcode 4.6 and improvement in this area and this is why the above-linked question suggested problems that I am not encountering?
I read on this question that Xcode keeps its repositories separate from the repository created using git manually from terminal. Yet, my experience suggests Xcode is in fact finding it fine.
You are right, it is fine (at least for what I use it for).
Does it matter from the sake of functionality whether the repository is created with Xcode or manually from the terminal?
No, it doesn't.
Can the two be used interchangeably on the same project? Will the same repository be used?
Yes and yes.
Is perhaps the latest Xcode 4.6 and improvement in this area and this is why the above-linked question suggested problems that I am not encountering?
Likely, although at least with Xcode 4.5 it worked for me as well.

XCode 4.3 and SVN

I'm new to iOS developing, I haven't used earlier versions of XCode.
Yet I have stored my project on my local hd. Now I want to use some online subversion service.
I cannot seem to find the appropriate options in XCode. The hints that I googled all refer to a menu called SCM which I don't seem to have.
I created a new and empty repository online (webbased) and tried to configure XCode to use it by selecting the "Connect to a repository" menu when xcode starts. After some tweeking in the command line this "connect to a repository" succeeded but afterwards XCode simply closed itself again.
I tried copying the files that belong to my project to the path that I set up to be used with SVN manually. I opened the project in XCode from that path and after adding another file wanted to commit that change but couldn't find how to do that from within XCode.
Now I found that in XCode / Organizer / Repositories / MyProject is listed but has the type "GIT", which is wrong.
Do I have to change the repository type to SVN instead of GIT? If so, how can I?
When you created the project there was an option to put the project under source control. This option creates a git repository and is checked by default.
To use SVN you have to import your project into the SVN repository. (And you probably don't want it to be under git and svn at the same time, so you'll either delete the .git folder or recreate your project without the scm option selected.) Once the project is imported into your repository then you make sure Xcode knows about the repository and you can check the project out.
But really I'd recommend just using Git. It's a modern version control system with lots of nice features (though to do much of anything out of the ordinary requires using the command line) and there are nice project hosting sites for it like GitHub. I don't think SVN compares very well to git.

Resources