-
-
Save cod3cow/96e99a313adcbc0f1705 to your computer and use it in GitHub Desktop.
.gitconfig
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
[color] | |
status = auto | |
diff = auto | |
branch = auto | |
interactive = auto | |
ui = true | |
[alias] | |
amend = !"git commit --amend -C HEAD" | |
s = status | |
a = add -A | |
c = commit -am | |
b = branch | |
co = checkout | |
l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
ls = log --pretty=format:“%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]” --decorate | |
ll = log --pretty=format:“%C(yellow)%h%Cred%d\\ %Creset%s%Cblue\\ [%cn]” --decorate --numstat | |
sm = log --summary | |
pullre = pull --rebase | |
# clean up local branches, which are already merged | |
cleanup = !git remote prune origin && git branch --merged | egrep -v '(^\\*|master|main|develop|dev)' | xargs git branch -d | |
set-upstream = ! git branch --set-upstream-to=origin/`git symbolic-ref --short HEAD` | |
# hard reset | |
rshard = reset --hard HEAD | |
# undo last commit keeping files in stage | |
undo = reset --soft HEAD^ | |
untracked = ls-files . --exclude-standard --others | |
ignored = ls-files . --ignored --exclude-standard --others | |
# unstage file | |
unstage = reset HEAD | |
# unstage and remove local changes | |
discard = checkout HEAD | |
# show git aliases | |
aliases = config --get-regexp alias | |
# list contributor stats for this repo | |
contributors = !git shortlog -n -s --no-merges $@ | cat - && echo && echo total $(git rev-list --count HEAD) | |
# decorated graph view of one liner summarized commits from all branches. (inspired by git-extras) | |
tree = log --all --graph --decorate --oneline --simplify-by-decoration | |
# tracks any staged files onto the last commit you created | |
commend = commit --amend --no-edit | |
# git status in short | |
shorty = status --short --branch | |
# uses the --no-ff strategy, to always create a merge commit | |
merc = merge --no-ff | |
# graphical log | |
grog = log --graph --abbrev-commit --decorate --all --format=format:\"%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(dim white) - %an%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n %C(white)%s%C(reset)\" | |
[user] | |
name = Alexander Schmidt | |
email = [email protected] | |
[core] | |
excludesfile = /Users/alschmidt/.gitignore | |
[difftool "sourcetree"] | |
cmd = opendiff \"$LOCAL\" \"$REMOTE\" | |
path = | |
[mergetool "sourcetree"] | |
cmd = /Users/alschmidt/Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\" | |
trustExitCode = true | |
[filter "lfs"] | |
required = true | |
clean = git-lfs clean -- %f | |
smudge = git-lfs smudge -- %f | |
process = git-lfs filter-process | |
[credential] | |
helper = osxkeychain | |
[pull] | |
rebase = false | |
[push] | |
default = current |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
LOCATION
Linux: ~/.gitconfig
Mac: ~/.gitconfig
Windows: C:\Users<user_name>.gitconfig