# local user config, usernames, etc [include] path=~/.config/.gitconfig.local [color] diff = auto status = auto branch = auto interactive = auto ui = auto [help] # Automatically correct and execute mistyped commands. autocorrect = 1 [branch] # Show most recently changed branches first. sort = -committerdate [push] default = simple autoSetupRemote = true [diff] tool = default-difftool [difftool "default-difftool"] cmd = code --wait --diff $LOCAL $REMOTE [filter "media"] clean = git media clean %f smudge = git media smudge %f required = true [alias] # Shorten some often used commands b = branch c = commit sw = switch swm = switch master co = checkout com = checkout master ss = status s = status -s ds = diff --staged amend = commit --amend -c HEAD oops = reset --soft HEAD~1 kris = pull --rebase ignore = !git update-index --assume-unchanged unignore = !git update-index --no-assume-unchanged ignored = !git ls-files -v | grep "^[[:lower:]]" undo = reset --soft HEAD^ squash = rebase --autostash -i megasquash = "!f() { git rebase --autostash -i `git merge-base --fork-point HEAD master`; }; f" unstage = restore --staged # fzf commands cf="!checkout_fzf() { git branch | fzf-tmux -p -h 25% --header 'git checkout' | xargs git checkout; }; checkout_fzf" sf="!switch_fzf() { git branch | fzf-tmux -p -h 25% --header 'git switch' | xargs git switch; }; switch_fzf" af = "!add_files() { git status -s | awk '{print $2}' | fzf-tmux -m --header 'git add' | xargs git add; }; add_files" afc = "!add_files_and_commit() { git status -s | awk '{print $2}' | fzf-tmux -m --header 'git add and commit' | xargs git add && git commit --verbose; }; add_files_and_commit" mf = "!merge() { git branch | fzf-tmux -p -h 25% --header 'git merge' | xargs git merge; }; merge" # various pretty loggers from various places l = log --pretty=oneline --abbrev-commit lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative lgg = log --graph --pretty=format:'%Creset %s' --abbrev-commit lc = log ORIG_HEAD.. --stat --no-merges # from http://blog.kfish.org/2010/04/git-lola.html lol = log --graph --decorate --pretty=oneline --abbrev-commit lola = log --graph --decorate --pretty=oneline --abbrev-commit --all ll = log --graph --date=short # List contributors with number of commits. contributors = shortlog --summary --numbered # Show the user email for the current repository. whoami = config user.email