Skip to content

Instantly share code, notes, and snippets.

@andypeters
Last active April 9, 2017 14:25
Show Gist options
  • Save andypeters/5776922 to your computer and use it in GitHub Desktop.
Save andypeters/5776922 to your computer and use it in GitHub Desktop.
my .gitconfig
[user]
email = <EMAIL>
name = <NAME>
signingkey = <KEY>
[color]
status = always
[commit]
gpgsign = true
# https://code.visualstudio.com/docs/editor/versioncontrol
[diff]
tool = default-difftool
[difftool "default-difftool"]
cmd = code --wait --diff $LOCAL $REMOTE
[core]
editor = code --wait
excludesfile = /PATH/TO/HOME/.gitignore_global
[filter "lfs"]
clean = git-lfs clean %f
smudge = git-lfs smudge %f
required = true
[push]
default = matching
[mergetool]
keepBackup = true
[web]
browser = google-chrome
[alias]
st = status
ci = commit
cia = commit --amend
co = checkout
br = branch
sb = show-branch
cp = cherry-pick
staged = diff --cached
rb = rebase
rbc = rebase --continue
rbs = rebase --skip
rl = reflog
rs = remote show
rt = remote
ru = remote update
rp = remote prune
sm = submodule
aa = add --all
hist = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit --date=relative
type = cat-file -t
dump = cat-file -p
fuckit = !"git reset --hard HEAD"
wip = !"git add -A; git ls-files --deleted -z | xargs -0 git rm; git commit -m \"wip\""
unwip = !"git log -n 1 | grep -q -c wip && git reset HEAD~1"
rb = !"git wip;git rebase -i origin/master;git unwip"
pr = !"git fetch;git wip;git rebase --stat origin;git unwip;git heads"
head = !"git log -n1"
lost = !"git fsck | awk '/dangling commit/ {print $3}' | git show --format='SHA1: %C(yellow)%h%Creset %f' --stdin | awk '/SHA1/ {sub(\"SHA1: \", \"\"); print}'"
heads = !"git log origin/master.. --format='%Cred%h%Creset;%C(yellow)%an%Creset;%H;%Cblue%f%Creset' | git name-rev --stdin --always --name-only | column -t -s';'"
@andypeters
Copy link
Author

andypeters commented Apr 9, 2017

Updated with gpg code signing and Visual Studio code as my git editor.

Aliases I've just collected over time

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment