I’m a recent convert to Git, and have had trouble finding decent installation instructions for Leopard. Here are the steps I followed to successfully install Git on Mac OS X 10.5.2 Leopard.
Prerequisites
- The OS X Developer tools installed from the Leopard DVD
- Download the latest Git source package from git.or.cz
- Download the latest version of Gettext
Step 1: build and install Gettext
Gettext is required for building Git. If you don’t have it available, you’ll get an error such as:
First extract the archive:
Next, read any updated instructions and build it:
Finally, install it
Step 2: build and install Git
These instructions are fairly similar, except for a small configuration setting. Again, extract the archive:
Next, read any updated instructions and build it. If you omit the --prefix setting, git will be installed into your ~/bin directory.
Finally, install it
Once this is complete, you should be able to run it. Try this:
The most commonly used git commands are:
add Add file contents to the index
bisect Find the change that introduced a bug by binary search
branch List, create, or delete branches
checkout Checkout and switch to a branch
clone Clone a repository into a new directory
commit Record changes to the repository
diff Show changes between commits, commit and working tree, etc
fetch Download objects and refs from another repository
grep Print lines matching a pattern
init Create an empty git repository or reinitialize an existing one
log Show commit logs
merge Join two or more development histories together
mv Move or rename a file, a directory, or a symlink
pull Fetch from and merge with another repository or a local branch
push Update remote refs along with associated objects
rebase Forward-port local commits to the updated upstream head
reset Reset current HEAD to the specified state
rm Remove files from the working tree and from the index
show Show various types of objects
status Show the working tree status
tag Create, list, delete or verify a tag object signed with GPG
That should do it!
Why not simply sudo port install git-core? Does it not work on Leopard?
As suggested, another approach is to use MacPorts. Many people, including myself, would prefer not to install yet another package on their system.