Previously we looked at installing Git on Mac OS X. Now let’s take a look at using it. The first step is to add a new local git repository that looks to a remote repository. In the following example I’m going to add a local repository called custom-safari based on the git repository at packages/custom-safari on git.krypted.com.
git remote add custom-safari git://krypted.com/packages/custom-safari.git
Next make sure you’re using the latest from the repository:
Then checkout from the master git branch:
git checkout -b custom-safari/master
Now pull the files you’ve checked out:
git pull custom-safari master
Now you can do your work. Edit the files, wok on them and when you’re done we’ll look at putting them back in the repository. Before all commits, make sure to know which files are the most recent:
Commit your changes:
git commit -a
Finally, push your changes back to your master:
Once you’ve started working with git you may find that you would like to customize a few of the settings to make life a little easier. For these, check out the alias.st, alias.ci, alisas.co and alias.br, which can be really helpful.
git config –global color.ui auto
If you screw up and want to reset your local repository:
git checkout -f
Figure out what changed: