Install Git Separately from Xcode

First, I apologize if this is a really simple question, but Git is completely new to me. Basically, Iโ€™m doing a bit of iOS development, and now I have a project idea that I want to start working with, and I plan to include it in the initial control for the first time.

Now I know that Xcode 4 has some Git integration, but I noticed a couple of posts that suggest that the integration is not so useful, and itโ€™s better to do this using the command line.

So, I followed the instructions here http://git-scm.com/book/en/Getting-Started-Installing-Git , and I downloaded Mac version 1.7.10.3 and completed the installation.

However, when I run Git --version, I get version 1.7.4.4, which is the version that was installed with Xcode, I assume?

My question is: how do I use my new version 1.7.10.3? The plan is to learn how to use Git using command tools and set up a central repository on the server that I have at home, and then have local copies on my laptop.

As I said, I'm actually new to this, so a quick, step-by-step guide for idiots would be helpful. I searched and tried to find the details here and on google, but apart from the suggestion to use Git outside of Xcode, I did not find exactly how to do this.

Any advice or links to a decent tutorial that covers this would be greatly appreciated.

Update:

I changed the path to the new path in .bash_profile (/ usr / local / git / bin) and now I get Git version 1.7.7.5 (Apple Git -26). This still seems to be the wrong version (although it may be me tight). I downloaded the installer for OSX from the link above. Should I do something else. I want to play with command line tools so that I can understand correctly

Update 2:

Now I'm also trying to use MacPorts, as recommended in the article. It seems like loading is a lot more than just git, though

+8
git xcode macos
source share
2 answers

Xcode installs git in /Applications/Xcode.app / ... but if you run "Install Command Tools", git will also be installed in / usr / bin / git. Xcode uses its personal version in Xcode.app. If you installed git in / usr / local / git / bin, you need to include this directory in your PATH. You must have a .bashrc file (or equivalent for any shell you use). Add

PATH=/usr/local/git/bin:$PATH # your shell might use different syntax. 

to the 'rc' file of the file.

Also, note that Xcode will allow you to complete your task of setting up a remote home while maintaining a local copy on your laptop. Go to the Xcode organizer and click on "Vaults". There you will find all your git repositories. Choose one, select the โ€œremotesโ€ folder, and then โ€œ+โ€ to add your home remote. I use Xcode this way.

+10
source share

Credits go to @GoZoner for an answer. I just summarize everything.

Download the official git installer from http://git-scm.com/download/mac

Install and add its directory to your path: echo "PATH=/usr/local/git/bin:\$PATH" >> ~/.bash_profile source ~/.bash_profile

+1
source share

All Articles