Last active
January 30, 2017 07:38
-
-
Save sergelerner/680830766363ab1143e6c75462d177a2 to your computer and use it in GitHub Desktop.
My .gitconfig
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
| # Many goodies from here and all around http://stackoverflow.com/questions/267761/what-does-your-gitconfig-contain | |
| [user] | |
| name = Serge Lerner | |
| email = [email protected] | |
| [color] | |
| diff = auto | |
| status = auto | |
| branch = auto | |
| interactive = auto | |
| ui = true | |
| pager = true | |
| [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 | |
| [alias] | |
| st = status | |
| # diff stats | |
| ds = !git --no-pager diff --stat -M -w | |
| ci = commit | |
| br = branch | |
| co = checkout | |
| w = whatchanged | |
| up = !git pull --rebase --prune $@ && git submodule update --init --recursive | |
| bclean = "!f() { git branch --merged ${1-master} | grep -v " ${1-master}$" | xargs git branch -d; }; f" | |
| bdone = "!f() { git checkout ${1-master} && git up && git bclean ${1-master}; }; f" | |
| # Visual Diff tool (Diff all changed files at the same time) | |
| vdiff = !git-diff-all.sh | |
| # show list of contributors in descending order by number of commits | |
| rank = shortlog -sn --no-merges | |
| # given any git object, try to show it briefly | |
| whatis = show -s --pretty='tformat:%h (%s, %ad)' --date=short | |
| # Search for a given string in all patches and print commit messages | |
| # example: search for any commit that adds or removes string "foobar" | |
| # git searchcommits foobar | |
| # example: search commits for string "foobar" in directory src/lib | |
| # git searchcommits foobar src/lib | |
| # example: search commits for "foobar", print full diff of commit with 1 line context | |
| # git searchcommits foobar --pickaxe-all -U1 src/lib | |
| searchcommits = "!f() { query=\"$1\"; shift; git log -S\"$query\" \"$@\"; }; f \"$@\"" | |
| # Change log in a compact format | |
| changes = log --oneline --reverse | |
| # shows a nice graph of branches/merges | |
| graph = log --graph --pretty=format:'%C(red)%h%C(reset) %C(yellow)%d%C(reset)%s %C(green)%an %C(bold black)%cr%C(reset)' --abbrev-commit --date=relative | |
| # list of tags | |
| tags = tag -n1 -l | |
| # After I accidentally commit too much and want to roll back the commit but keep the changes: | |
| uncommit = reset --soft HEAD^ | |
| # Amend last commit's message | |
| amend = commit --amend | |
| # The usual push command | |
| ps = push origin master | |
| # The usual pull command with a --rebase b/c that's how I like it | |
| pl = pull --rebase origin master | |
| [diff] | |
| tool = sublimerge | |
| [difftool "sublimerge"] | |
| cmd = subl -n --wait \"$REMOTE\" \"$LOCAL\" --command \"sublimerge_diff_views {\\\"left_read_only\\\": true, \\\"right_read_only\\\": true}\" | |
| [merge] | |
| tool = sublimerge | |
| [mergetool "sublimerge"] | |
| cmd = subl -n --wait \"$REMOTE\" \"$BASE\" \"$LOCAL\" \"$MERGED\" --command \"sublimerge_diff_views\" | |
| trustExitCode = false | |
| [core] | |
| pager = less -FRSX | |
| whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol | |
| [apply] | |
| whitespace = fix | |
| [credential] | |
| helper = osxkeychain |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment