1

I have two Macs that I develop from, one an iMac and one a MacBook Air. I am starting to work more on both machines and I would like to easily share the code between the two.

My iMac is always on, and usually I am only coding at home anyways, so it depends on where I want to be if I am coding on the MacBook or iMac.

When setting up a new project in Xcode 4, it asks you if you want to create a git repository for your project. If I say yes (on my iMac) is there a way I can connect to this repo from my MacBook?

If so, how is this done? If I add a location, it will see my iMac, but im not sure what to set up after that. And do I have to do this for each project?

EDIT: When I try to add the remote repository in Xcode, while it says Host Reachable, I eventually get an error that access to the Repository is denied.

3 Answers 3

1

Make sure that "Remote Login" (ssh) is enabled in the "Sharing" section of your system preferences.

I suggest generating an SSH keypair as well, this will make the whole process smoother (as long as you understand the potential risk).

Sign up to request clarification or add additional context in comments.

7 Comments

Remote login is enabled. I understand the risk, but haven't done keypairs yet
Have you tried git clone ssh://host/path/to/repo? Can you SSH to your other computer?
Yes, and I am working on the keys right now. If I clone it through SSH, it works fine.
Does this count as solved, then? Or is there something else you want it to do?
Well, was hoping to do this through Xcode, as in, even if I clone through ssh, can I use the versioning features in Xcode on each machine?
|
0

Would you be willing to do so outside of XCode 4? I don't think this is possible in Xcode 4, but from console, you can add a git remote to the MBA or iMac from each of them and pull and push between them as and when you desire. You can probably even set a post-commit hook in each of them to push to the other after every commit and that way you don't have to care about the sync. And why don't you start by copying over the project from one to the other rather than creating a new one?

1 Comment

I don't mind working outside Xcode 4 (was planning to probably do it through terminal anyways), but haven't looked into this yet, and figured it would be pretty easy just inside Xcode. Do you have a link that explains this a bit?
0

I managed this quite easily by using normal file sharing under OS X. After creating the repository on my iMac, I navigated to my iMac over the network from my MacBook, mounted my home directory by clicking on it. Once the volume is mounted you can then refer to it from the route directory under the Volumes folder. So in xCode, when asked for the repository location you can use /Volumes/etc/etc

This worked first time for me, no need to enable SSH or play around in Terminal, just make sure you have File Sharing enabled.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.