Pulling from Git

Perhaps Git is still new, I couldn’t find any one-click solutions to simply pulling a copy from a git repository in osx. If you are new to git, and you are a osx user, and you just want to pull the latest code from a repository, you are at the right place. I will show you the quickest way to do just that.

1. First download git-osx-installer at http://code.google.com/p/git-osx-installer/
2. Install it (you will need root login). After that, you should have /usr/bin/git
3. Say you want to pull from git://github.com/omz/AppSales-Mobile.git
4. Make a directory, for example: mkdir myApp
5. cd myApp
6. At this point, you would want to do a “git clone git://github.com/omz/AppSales-Mobile.git”. However, I bet you will get some error messages. So read on. 😉
7. Type “locate git-core”, check to see that you have “/usr/local/git/share/git-core/templates/”.
8. Type “locate index-pack”, check to see that you have “/usr/local/git/libexec/git-core/git-index-pack”
9. Now, set the path: export PATH=/usr/local/git/libexec/git-core/:$PATH (or wherever git-index-pack is located at from step #8)
10. Issue this command: git clone --template=/usr/local/git/share/git-core/templates/ git://github.com/omz/AppSales-Mobile.git

This should probably save you some time googling around…

If you are doing more than just pulling code, you should probably add the path info into your bashrc file or so.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s