Revisions
-






4181d4
jschementi
Sun Dec 13 10:35:43 -0800 2009
-






c9bfaf
jschementi
Wed Sep 09 02:19:43 -0700 2009
-






abeb27
jschementi
Mon Jun 15 11:10:13 -0700 2009
-






6d0298
jschementi
Mon Jun 15 10:57:22 -0700 2009
-






40dd06
jschementi
Fri May 29 15:49:49 -0700 2009
-






49aad6
jschementi
Thu May 14 15:53:47 -0700 2009
-






cf7411
jschementi
Sun Mar 08 12:13:49 -0700 2009
-






acb1fd
jschementi
Sun Feb 08 15:46:27 -0800 2009
-






e66a33
jschementi
Sat Feb 07 13:16:23 -0800 2009
-






421621
jschementi
Thu Feb 05 01:27:54 -0800 2009
Every gist with this icon (
Every repository with this icon (
Add colors to your ~/.gitconfig 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
Highlight whitespace in diffs
[color]
ui = true
[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
Configuration
Sets your email for commit messages.
git config user.email johndoe@example.com
Sets your name for commit messages.
git config user.name 'John Doe'
Tells git-branch and git-checkout to setup new branches so that git-pull(1) will appropriately merge from that remote branch. Recommended. Without this, you will have to add —track to your branch command or manually merge remote tracking branches with "fetch" and then "merge".
git config branch.autosetupmerge true
You can add "—global" after "git config" to any of these commands to make it apply to all git repos (writes to ~/.gitconfig).
Branching
Create local branch
git branch search
Push local branch
git push origin search
Delete local branch
git branch -d search
Delete remote branch from remote repo (permanently)
git push origin :search
Remove remote branch from local repo
git branch -d -r origin/search
Rename local branch
git branch -m search dev/search
Track a single remote branch as a local branch
git checkout —track -b foo origin/foo
Pushing all local branches to remote, creating new remote branches as needed
git push —all origin
Merging
Merge a branch into the current branch
git merge foo
Remote
Create a "bare" git repo (just the contents of the .git folder) in the current directory
git --bare init
Add a remote
git remote add origin git@github.com:jschementi/foo.git
Rebase
Move all your commits in a "topic" branch to the top of the log
git rebase master topic
Interactively rebase (reorder, combine, and delete commits)
git rebase --interactive master topic
Tags
Create a tag at the current commit
git tag -a this-is-a-tag
Push tags
git push --tags


