Creating a Git environment in OS X

If Hombrew has not been installed in your system, you c…

git

If Hombrew has not been installed in your system, you can install it with this line.

“ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)”

Once installed you can configure following things

Your name
git config –global user.name “Your Name”
Your e-mail
git config –global user.email “you@example.com”
Alias for checkout. Instead of ‘git checkout’ this will allow you to use ‘git co’
git config –global alias.co checkout
git config –global apply.whitespace nowarn

Then you need to setup your SSH key and password with the following lines

ssh-keygen
cat ~/.ssh/id_rsa.pub | pbcopy

All OSX folders contain a .DS_Store, to avoid to be committed and pushed to git, we can create a file called ‘.gitexcludes’ in the home directory.  To that file add the following lien

.DS_Store

In case you want to configure colors, logs etc you can do it by going to home and editing the ‘./config’ file.

[color]
    branch = auto
    diff = auto
    status = auto
[color “branch”]
    current = yellow reverse
    local = yellow
    remote = green
[color “diff”]
    meta = yellow bold
    frag = magenta bold
    old = red bold
    new = green bold
[color “status”]
    added = yellow
    changed = green
    untracked = cyan