Permalink
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
175 lines (148 sloc) 6.38 KB
[user]
name = patrick nsukami
email = ndkpatt@gmail.com
[core]
excludesfile = /home/nsukami/.gitignore
editor = emacs -nw
autocrlf = input
[alias]
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /'
pulled-changes = !git log -p -2
not-yet-pulled = !git log --name-status origin/master
lastco = log -1 HEAD --numstat
last-diff = !git diff HEAD^ HEAD
# undoing things
undo-commit = reset --soft HEAD^
undo-add = reset HEAD
undo-modif = checkout
undo-merge-conflict-fix = reset --hard
# abort-merge = reset --hard HEAD
abort-merge = merge --abort
unassume-unch = update-index --no-assume-unchanged
list-assumed-unch = "!git ls-files -v | grep ^[a-z]"
unassumeall = "!git assumed | xargs git update-index --no-assume-unchanged"
drop-all-modifs = "!git checkout -- ."
# branches
current-branch = rev-parse --abbrev-ref HEAD
create-branch-from-stash = !git stash branch
create-branch = checkout -b
rename-branch = branch -m
goto-branch = checkout
delete-local-branch = branch -d
delete-remote-branch = push origin --delete
assume-unch = update-index --assume-unchanged
list-assumed-unch = !git ls-files -v | grep "^[[:lower:]]"
assumeall = "!git st -s | awk {'print $2'} | xargs git assume-unch"
fixme = grep --heading --break --ignore-case -e 'FIX: *' -e 'FIXME: *'
todo = grep --heading --break --ignore-case -e 'TODO: *'
fix-latest-commit = commit --amend
panic = !tar cvf ../git_panic.tar *
current-branch = rev-parse --symbolic-full-name --abbrev-ref HEAD
number-of-commits-since-master = "! sh -c 'git log master..`git current-branch` --oneline | wc -l | tr -d \" \"'"
std = "! sh -c 'git status -s | while read mode file; do echo $mode $file $(stat -c %y $file); done'"
up = !git pull --rebase
ec = config --global -e
cl = clone
ct = checkout
co = commit
#cos = commit --gpg-sign=7C8BEEE4613F8484
cos = commit -S
cov = commit --verbose
#covs = commit --gpg-sign=7C8BEEE4613F8484 --verbose
covs = commit -S --verbose
com = commit -m
#coms = commit --gpg-sign=7C8BEEE4613F8484 -m
coms = commit -S -m
st = status
sts = status -s
stu = status -uno
dma= !git checkout -- .
br = branch
dc = diff --cached
au = add -u
cp = cherry-pick
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
type = cat-file -t
dump = cat-file -p
stash = stash save -u # stash even the untracked files, and add a clear message
count-commit = rev-list --count
# log
compactlog = log --pretty=format:"%Cgreen%h%Creset%x09%Cred%an%Creset%x09%ad%x09%s" --date=short
ll = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --numstat
ls = log --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=relative
log-diffs = log -u
log-me = !UN=$(git config user.name)&& git ld --author="\"$UN\""
lol = log --graph --decorate --pretty=oneline --abbrev-commit
lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
show-history ="!git log -p "
# reset
r = reset
r1 = reset HEAD^
r2 = reset HEAD^^
rh = reset --hard
rh1 = reset HEAD^ --hard
rh2 = reset HEAD^^ --hard
# how to pass params to git aliases
my-alias1 = "!f(){ echo \"$@\"; }; f" # define a func, then call the func.
my-alias2 = "! date " # call the cmd directly
log-remote = "!git log HEAD..origin"
# check if file is tracked
is-tracked = "!t(){ git ls-files $1 --error-unmatch; echo $?; }; t"
back = "!f(){git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}};}; f"
# add to last commit file that are actually staged
commend = commit --amend --no-edit
commend-edit = commit --amend -S
it = !git init && git commit -m \"root\" --allow-empty
# always create a merge commit when merging branches
merc = merge --no-ff
dfw = diff --ignore-space-change
changes = diff --name-status -r
diffstat = diff --stat -r
filepath = "!git ls-files | grep -i"
# aliases I've never used
lg1 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
lg2 = log --graph --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit
lg = !"git lg1"
parent-branch = !"git show-branch -a | ack '\\*' | ack -v \"`git current-branch`\" | head -n1 | sed 's/.*\\[\\(.*\\)\\].*/\\1/' | sed 's/[\\^~].*//'"
[color]
ui = always
branch = auto
diff = auto
interactive = auto
status = auto
[commit]
template = /home/nsukami/.gitcommitmessagetemplate.txt
[status]
# be careful with that one
# showUntrackedFiles = all
[push]
# git push branch I'm currently on
default = matching
[init]
templatedir = ~/.git_template
[merge]
tool = emerge
[github]
user = lemeteore
[include]
path = ~/.gitconfig.local
[rerere]
# "reuse recorded resolution"
# it will record how you solved previous conflicts
# next time it finds the same conflict it will just apply your previous fix.
enabled = true
[gpg]
program = "/usr/bin/gpg"
[pull]
# git pull --rebase by default
rebase = true
[branch]
# This will ensure that whether you checkout a remote branch,
# or create a new one; the tracking information will be handled
# automatically by git. Then you will be able to
# git clone <some_repo>
# git checkout -b <new_branch>
# git push
# git pull
autoSetupMerge = always