6/14/2012 - 8:49 PM

Install git from scratch

Install git from scratch

# Install git from (OS X version)
# use this complite script to detect OS:
# for OS X download and install package from here: 

git config --global merge.tool opendiff

# Ignore Carp
git config --global core.excludesfile ~/.gitignore
touch               "$HOME/.gitignore"
echo '.DS_Store' >> "$HOME/.gitignore"
echo '._*'       >> "$HOME/.gitignore"
echo '.svn'      >> "$HOME/.gitignore"
echo '.hg'       >> "$HOME/.gitignore"

# Shortcuts
git config --global status
git config --global commit
git config --global checkout
git config --global branch

# Colors? YES!
git config --global color.ui auto

# Personal Setup
git config --global "Your Name"
git config --global

# Setup Bash Completion
mkdir -p "$HOME/bin"
export PATH="$HOME/bin:$PATH"
echo 'export PATH="$HOME/bin:$PATH"'               >> ~/.bash_profile
cp "/usr/local/git/contrib/completion/git-completion.bash" ~/bin
echo 'source ~/bin/git-completion.bash'            >> ~/.bash_profile

# Add the current Git Branch to your Bash Prompt
echo "PS1='[\u@\h \w\$(__git_ps1 \" (%s)\")]\\$ '" >> ~/.bash_profile

# Generate ssh key
mkdir ~/.ssh; cd !$;
ssh-keygen -t rsa -C ""
# Copies the contents of the file to your clipboard
pbcopy < ~/.ssh/
echo "RSA key is copied to clipboard, add it to your github account"