Created
March 10, 2022 21:51
-
-
Save jameskyle/0d4fb6ca295281443131946d44b5b11e to your computer and use it in GitHub Desktop.
Aliasess and short cuts for git.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = <name> | |
email = <email> | |
username = <username> | |
[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 | |
[color] | |
ui = true | |
[core] | |
whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
excludesfile = ~/.gitignore | |
pager = less | |
editor = vim -c ':normal gg' | |
[apply] | |
whitespace=fix | |
[branch] | |
autosetupmerge = true | |
[github] | |
user = <gitusername> | |
token = <git-token> | |
oauth-token = <git-oauth-token> | |
[mergetool "fugitive"] | |
cmd = vim -f -c \"Gvdiff\" \"$MERGED\" | |
[mergetool "sourcetree"] | |
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" | |
trustExitCode = true | |
[push] | |
default = upstream | |
[alias] | |
cp = cherry-pick | |
st = status -s | |
cl = clone | |
ci = commit | |
co = checkout | |
br = branch | |
bv = branch -vv | |
diff = diff --word-diff | |
dc = diff --cached | |
df = diff | |
sl = stash list | |
sa = stash apply | |
ss = stash save | |
logp = log -p | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
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 | |
track = !sh -c 'git branch --track "$0" "origin/$0" && git checkout "$0"' | |
ls-files-ignored = !sh -c 'git ls-files --others -i --exclude-standard' | |
clean-all = clean -x -d -f | |
ls = log -n20 --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate | |
ll = log -n20 --pretty=format:"%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate --numstat | |
lnc = log -n20 --pretty=format:"%h\\ %s\\ [%an]" | |
lds = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate --date=short | |
ld = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%an]" --decorate --date=relative | |
le = log --oneline --decorate | |
filelog = log -u | |
fl = log -u | |
dl = "!git ll -1" | |
dlc = diff --cached HEAD^ | |
dr = "!f() { git diff "$1"^.."$1"; }; f" | |
lc = "!f() { git ll "$1"^.."$1"; }; f" | |
diffr = "!f() { git diff "$1"^.."$1" $2 $3; }; f" | |
f = "!git ls-files | grep -i" | |
grep = grep -Ii | |
gr = grep -Ii | |
gra = "!f() { A=$(pwd) && TOPLEVEL=$(git rev-parse --show-toplevel) && cd $TOPLEVEL && git grep --full-name -In $1 | xargs -I{} echo $TOPLEVEL/{} && cd $A; }; f" | |
la = "!git config -l | grep alias | cut -c 7-" | |
done = "!f() { git branch | grep "$1" | cut -c 3- | grep -v done | xargs -I{} git branch -m {} done-{}; }; f" | |
rmrb = "push --delete origin" | |
files = show --pretty="" --name-only | |
user-stat = "!f() {git log --shortstat --author=\"$1\" | grep -E \"fil(e|es) changed\" | awk '{files+=$1; inserted+=$4; deleted+=$6} END {print \"files changed: \", files, \"lines inserted: \", inserted, \"lines deleted: \", deleted }'}: f" | |
[credential] | |
helper = osxkeychain | |
[mergetool "sublime"] | |
cmd = subl -w $MERGED | |
trustExitCode = false | |
[merge] | |
tool = meld | |
[pull] | |
rebase = false |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment