Yesterday I ‘installed’ git on another MacBook – the process is pretty easy. Simply open a terminal session & type the command “git“. Follow the prompts as OS X installs the Command Line Tools. Be sure to update them by visiting the App Store once the install is complete.
The harder thing is to initialize the git installation. Here is what I am doing, based upon the suggestions found in Pro Git (link below). I’m sanitizing some of the fields – they should obviously be set to appropriate values for other environments.
- Set username & email address
- git config –global user.name “Tim Armstrong”
- git config –global user.email tima@tims-zone.info
- Set the default text editor
- The default default text editor is typically Vim. I like this and don’t change it, but it can be changed.
- git config –global core.editor <text editor>
- Verify the settings
- git config –list
Now that git is initialized, I should initialize a repository so that I can begin using git. Within a terminal session, either create a new directory or change to an existing one that contains (or will contain) files to manage. Once there type the command “git init“. The next step is to begin tracking any files that are in the directory, using the following commands:
- git add *
- git commit -m ‘initial project version’
That gets things started. I think that I’ll setup separate posts for each major action to be taken while managing the files/projects.
Lastly, here is a link to find the current version of the open source book on git, which can be downloaded for free and details everything that I’m doing.
https://progit.org