Git Cheatsheet – setup

Setup

git clone <repo>

clone the repository specified by <repo> ; this is similar to “checkout” in
some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

[color]
ui = 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

Highlight whitespace in diffs

[color]
ui = true
[color “diff”]
whitespace = red reverse
[core]
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol

Add aliases to your ~/.gitconfig file:

[alias]
st = status
ci = commit
br = branch
co = checkout
df = diff
lg = log -p

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s