Posted by: Brian Chan | Filed in: technology | Tags: git | 02:17 pm, August 25th, 20101 Comment »
Why is Git better? I can only say it’s simple and it makes sense. But apparently this guy Scott Chacon is passionate enough to set up a whole website to answer this question! Check it out at http://whygitisbetterthanx.com/!
If any of you out there are trying to learn Git, here is a free book online called Pro Git. It’s pretty clear and easy to understand.
What is Git?
Git is a free & open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.
Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.
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.