Xcode Git Bad Instructions - xcode

I was attempting to connect xcode and github(complete noob at this) and followed these instructions and for some reason I couldn't get it to work.
http://www.reddit.com/r/iOSProgramming/comments/1omi4n/setup_github_in_xcode_5/.
It requires you to go to the folder you stored your projects then start the commands. Now whenever I make a project in that same folder the xcode option to create a local git repository on this computer is grayed out. I can create a project anywhere else in my computer and I get the option.
I just created a new folder right next to it and moved my projects there but I don't like the idea of having changed some settings and not know how to reverse them. Tell me how to reverse them? Or at least what it is I did with each command?
Also if anyone has a solid guide of how to connect Xcode 5 to github it would be greatly appreciated. Most of the internet's information is on Xcode 4/4.5. The best one I could find is what messed up my local git options.

Related

Using Two IDEs ( xCode and VS 2015) for one project

I am struggling to get this right..
I do alot of work on my laptop using xCode.
My desktop is a win10 machine using VS.
I am using git on my mac but only using it on one machine.
I would like to use both machines to edit and commit to my assignments, etc.
My question is how may I accomplish this...I have exhausted google searches and
get more confused than anything, and I am sure this is simple.
When I create an xCode project, I will create multiple targets
as there might be 2 or 3 problems per assignment.
Xcode then creates a project file, etc.
When I go to my windows PC, if I go into VS and clone the repo,
there is not a compatible project file ( obviously, as its not xCode).
What is the simplest way to accomplish this? Keep in
mind I am a beginner with git.
Also, if I use a gitignore file and put it in the repo after the
repo has already had commits, will it drop and delete the
now ignored files moving forward?
Thanks in advance.

Xcode Server won't build because source control information is in an invalid format

I have XCode Server set up with XCode 6.4 and OSX Server 4.1.5. I had integrations running fine until I transferred my git repository to another bitbucket account. No big deal right? Wrong for me :(. After I transferred my repository, I changed my git remote, I changed the repository location in Preferences in Xcode on my dev computer as well as on my server. Regular git functions are working fine from the command line and from within XCode. Nothing seems wrong until I try to run an integration and then it gives me the following build service error:
Could not check out sources because the source control information is in an invalid format.
I tried deleting my bot and creating another one. I tried cloning my project straight from the new location into another folder in case something had gotten out of sync. I git reset hard to the remote branch just in case even though there was nothing different. I tried cleaning and restarting everything multiple times. I reset XCode Server too (sudo xcrun xcscontrol --reset) and am still getting the error making me think I really did somehow mess up my git repository as far as XCode is concerned, but I have no ideas about what XCode doesn't like about my source control information. Does anyone have any ideas for what I can do or try? I've been tearing my hair out for hours.

Xcode 5: The repository could not be reached

I have this issue with Xcode 5 where I'm trying to commit a file to a remote git repository (BitBucket) and getting a pop up window with the following error: "The repository "project_name" could not be reached. Please verify that the repository is online and reachable and try again."
I've been working with this setup for awhile now (since Xcode 4) and didn't have any problems with it. Under Xcode->Preferences->Accounts->Repositories I saw the correct repository, but duplicated. I deleted and added it again, but it didn't help. I tried closing the project and rebooting the computer and it didn't help either. I can see the project's history under Source Control->History. I can access the repository on BitBucket.
Any idea where this is coming from and how to solve this issue?
Not sure if this helps in the tracking down of this problem, but here goes anyway:
I have been connecting to a local network git repository perfectly well for a number of months, but I encountered this problem later yesterday and nothing I did seemed to improve the situation. That included:
Rebooting both the development machine and the server;
Reinstalling Xcode from the App Store;
Re-cloning the project from the git command line (which could see the repository perfectly well);
Checking out the repository from Xcode (I was able to check out but every other operation, such as , Commit, Refresh Status etc. seemed to cause the problem...)
Manipulation the repository with SourceTree (which could also see it fine).
Eventually I stumbled across a solution to my local issue. If I launch Xcode with a wired and wireless network enabled then I can't see the repository. If I close it, disable wifi and relaunch it then I can.
I've not had much opportunity to work out what the difference is (especially as the wifi connects to the same network and is the secondary choice for networking) but it does seem to fix it.
Hope that might help others and hopefully I can find a real explanation soon!
Dave,
Well it seems this had nothing to do with Bitbucket.
The problem was a messed up .git folder on my machine.
My project resides in a Dropbox folder. Somehow, perhaps because of accessing it from different machines, it created copy/duplicate files in the .git folder and it messed up Git. After fixing all the conflicts Git returned to working as usual and I was able to commit from Xcode to the remote repository.
Now, if you encounter this issue, you might not have the same setup as mine or work on Dropbox or any similar service, but I strongly recommend checking your Git folder thoroughly. Good chance something is messed up there.
Check internet connection of system.also quit xcode and reopen it.

How to use Xcode with a cloned git repository

I am new to gitHub and have been invited to work on a private project. I am familiar with XCode and would like to use it to work on the project for it's autocompletion capabilities that I am used to. My problem is I don't know how to set this up so that I can pull the git repository, edit and test in XCode and then push. I have gone through a few tutorials on setting up git in XCode and I am successful in being able to connect to a repository I have pulled, but don't know how to use this as an XCode project once I have done so.
Here are a few specifics:
I made an SSH key for my computer and have cloned the repository through the terminal. Obviously I can update the files here and then use git commit and git push, however I want to use XCode for editing for code completion.
This project has a make file, though I don't know how to use these other than just typing "make all" in the terminal. I am assuming that I can set this up with Xcode so that when I build it uses the make file, but reading the documentation on this made me realize I don't understand enough to set this up.
I have tried making an Xcode project and then importing my files, but the problem is that Xcode insists on making a directory inside the project folder with the same name as the project where it stores all of the files. Therefore all of the addresses for my header files become wrong.
I assume that cloning a git project and then editing in Xcode is pretty standard. Does anyone have a place I can go for help?
Download SourceTree from the app store. It's free and kicks ass. You can just clone it in the terminal window using 'git clone WhateverOneYouWant -b WhicheverBranch'. Then just drag the project from the finder into the main sourceTree window.
Or alternatively, you can just grab it directly from gitHub on the main opening page of xcode. If there are no projects currently open, in the left part of the opening window, you'll see a line that says 'connect to a repository'.
Let me know if you have questions!
This isn't an exact answer to your question, but it does work.
If you install git separately and clone from the command line, you can:
Use Spotlight to Locate the Project folder you cloned
Double click the corresponding .xcodeproj file and start editing.

Eclipse, import project but don't copy

I use Linux as primary operating system and I also have to work on a Windows virtual machine with Eclipse 3.7.
We're working with subversion but with Linux I'm happily using git-svn with Emacs+magit, which works great.
So I would like to be able to work on the same code from both OS, and only do the real version control management on Linux.
So I had the following thought:
1. share the directory with virtualbox
2. create the projects pointing to the shared directory
Well that doesn't work, because the dumb thing wants to copy everything.
So I tried to use virtual folders which seemed a good idea, but now some scripts are badly failing because they don't find the hard-coded paths.
So I don't know anymore what to try, any idea?
EDIT:
My last attempt in the last edit would not work, so I have a simpler question.
Given a git/svn/whatever repository checkout, why can't I simply tell to Eclipse create a project there without touching the files?
Is it so hard for Eclipse to create it's .project in that position?
And since there is clearly no "supported" way to do it, is there maybe any workaround?
From my experience, the stages are the following (using Indigo version):
1. Create new empty project
2. Click File->import->file system
3. in the import window import file system, check the files you want into the new project folder
4. Click on advanced in the import window and tick "create links in workspace"
The new project should contain links to the original directory.
Eclipse modifies and compiles source in its workspace. The first level of the workspace is the project directories, + a .metadata which is local only to that workspace instance. Traditionally, the workspace contains the projects it works on.
Eclipse also supports 2 linked modes. In one, when you create the project in the workspace you give it an absolute path to somewhere else on the file system. This is handy if you have eclipse projects in a git repo, for example.
In the other mode, you create the project in your workspace locally. Then you link your folders (source, resources, whatever) to somewhere else on the filesystem. This is useful for projects that don't want to save the eclipse specific files (.project, .classpath, etc) in their SCM.
You have to create a different workspace on each OS (there's no way around that). But you could create the projects in each workspace and link to the common location (I don't recommend it, but it would be do-able).
Same problem here and finally got a solution!
1) clone your repo but not directly to your workspace, in my case I used workspace2 instead of workspace.
2) On eclipse, import all the projects on workspace2, but don't mark the "copy files to workspace", so the source code is left on workspace2.
3) On git you will see changes appeared, on project.options files (only file date is changed) and in .path files (some lines changed its order). As all of them are irrelevant changes, reset the local branch discarding those changes.
Thats all, git sees no more changes and eclipse open the files properly!
I ran into a weird problem worth commenting here: after importing i went to "git gui" to see changes, and the first file changed was a "project.options" file that only changed its date but the diff was empty (as the content was unchanged). There is a bug on git that makes git gui enter on an infinite loop: while it detect changes on file and diff is empty, a rescan is performed, then the same change is detected and enter on a rescan loop.
There is a patch to solve this, but it was easier just to add a silly comment on that only file (not in all your project.options) and then "git gui" was happy again and i could reset the changes on the branch.

Resources