-
-
Save swport/5b0915c40afe74a74fe17e0fd6ccc185 to your computer and use it in GitHub Desktop.
My personal ~/.gitconfig file
This file contains 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 = Sumit Wadhwa | |
email = [email protected] | |
[alias] | |
aliases = !git config --get-regexp 'alias.*' | colrm 1 6 | sed 's/[ ]/ = /' | sort # list all aliases | |
cb = !git branch | grep ^* | cut -d' ' -f2 | |
branch-name = !git cb # alias to "cb" alias | |
st = status | |
ci = commit | |
cie = commit --allow-empty-message -m '' | |
cp = cherry-pick | |
br = branch | |
co = checkout | |
df = diff -C --color-words | |
pl = !git pull --rebase origin $(git cb) | |
ps = !git push origin $(git cb) | |
lg = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative --all | |
who = shortlog -s -- | |
push-hash = !sh -c 'git push origin $1:refs/heads/$(git cb)' - # requires a SHA or the remote branch will be deleted!! | |
reset-tags = "!f() { git tag -l | xargs git tag -d; git fetch; }; f" | |
cloner = clone --recursive | |
serve = !git daemon --reuseaddr --verbose --base-path=. --export-all ./.git | |
save = stash save -u | |
prune-local = !git branch --merged | grep -v master | grep -v dev | xargs -n 1 git branch -d | |
prune-all = !git remote | xargs -n 1 git remote prune | |
find = !sh -c 'git lg --grep="$@"' # search for a string in the commit message log | |
srch = !sh -c 'git grep "$@" $(git rev-list --all)' # search for a string in all commits | |
fixup = !sh -c 'git commit --fixup=$1' - | |
squash = !sh -c 'git commit --squash=$1' - | |
ri = rebase --interactive --autosquash --rebase-merges | |
oldest-ancestor = !zsh -c 'diff --old-line-format='' --new-line-format='' <(git rev-list --first-parent "${1:-master}") <(git rev-list --first-parent "${2:-HEAD}") | head -1' - | |
delete-tag = "!f() { git tag -d $1; git push origin :refs/tags/$1; }; f" | |
info = !sh -c 'git-info' - # requires https://github.com/gitbits/git-info | |
submodule-list = !git ls-files --stage | grep 16000 | |
[rerere] | |
enabled = true | |
[core] | |
#editor = st -n -w # Sublime Text | |
editor = code -n -w # VS Code | |
ignorecase = false | |
excludesfile = ~/.gitignore_global | |
[color] | |
ui = true | |
[branch] | |
autosetuprebase = always | |
[dude] | |
# notify-command = growlnotify -n \"$app_name\" -s --image \"$ICON_PATH\" -m \"$DESCRIPTION\" \"$TITLE\" | |
# icon ~/.git-dude/github_32.png | |
# notify-command = osascript -e \"display notification \\\"$DESCRIPTION\\\" with title \\\"$TITLE\\\"\" | |
notify-command = osascript -e \"display notification \\\"$DESCRIPTION\\\" with title \\\"$TITLE\\\" sound name \\\"Hero\\\"\" | |
[push] | |
default = upstream | |
[credential] | |
helper = osxkeychain | |
[filter "media"] | |
clean = git-media-clean %f | |
smudge = git-media-smudge %f | |
[instaweb] | |
local = false | |
port = 8080 | |
httpd = webrick | |
[filter "lfs"] | |
smudge = git-lfs smudge -- %f | |
process = git-lfs filter-process | |
required = true | |
clean = git-lfs clean -- %f | |
[fetch] | |
prune = true |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment