Re:Git Tips
by dongsheng on Monday September 12, 2011 @12:16AM
(#2985811)
Another tip is adding all this to .gitconfig:
[ Parent
| on HN ]
I’ve added my aliases to my bashrc instead.
alias git="hub"
alias ga="git add -A"
alias gap="git add -Ap"
alias gc="git commit -m"
alias gs="git status -sb"
alias gd="git difftool"
alias gb="git branch"
alias gco="git checkout"
alias gm="git merge --no-ff"
alias gp="git push"
alias gpl="git pull"
alias gf="git fetch"
alias gcl="git clone"
alias gr="git reset"
alias gl="git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative"
alias gre='git remote -v'I like :
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
I use these:
[alias]
l = log --oneline --decorate --graph
co = checkout
ci = commit
man = help
h = help
a = add
f = fetch
d = diff
dc = diff --cached
dt = difftool
dtc = difftool --cached
ds = diff --stat
dsc = diff --stat --cached
s = status --short --branch
b = branch