Skip to content

Instantly share code, notes, and snippets.

@yimun
Last active April 16, 2024 04:05
Show Gist options
  • Select an option

  • Save yimun/9c235597f836db4e58bc2929dd768e58 to your computer and use it in GitHub Desktop.

Select an option

Save yimun/9c235597f836db4e58bc2929dd768e58 to your computer and use it in GitHub Desktop.
祖传git配置
[user]
name = xxx
email = xxx
[alias]
cl = clone
lg = log --color --graph --pretty=log --abbrev-commit
lgs = lg --decorate-refs-exclude=refs/tags
ci = commit
cn = commit --amend --no-edit
st = status
co = checkout
br = branch
ec = config --global -e
cp = cherry-pick
rb = rebase
up = pull --rebase
upd = pull --rebase --no-recurse-submodules origin develop
su = submodule
suu = submodule update
re = remote
fc = fetch
rh = reset --hard
sth = stash
throw = reset --hard HEAD
rl = reflog --pretty=reflog
review = !sh -c 'git push origin HEAD:refs/for/$1' -
reviewc = !sh -c 'git push origin HEAD:refs/for/`git rev-parse --abbrev-ref HEAD`' -
draft = !sh -c 'git push origin HEAD:refs/drafts/$1' -
showtool = !sh -c 'git difftool $1~1 $1' -
ig = "!gi() { curl -L -s https://www.gitignore.io/api/$@ ;}; gi"
recent = for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
scp = !"git stash && git checkout \"$@\" && git stash pop --index #"
sshow = "!f() { git stash show stash^{/$*} -p; }; f"
sapply = "!f() { git stash apply stash^{/$*}; }; f"
frh = !"git fetch --all && git reset --hard \"$@\" #"
tmp = commit -m tmp --no-verify
cor = !"git checkout `git for-each-ref --sort=-committerdate refs/heads/ --format='%(refname:short)' | fzf`"
[core]
autocrlf = input
editor = vim
excludesfile = /Users/bytedance/.gitignore_global
quotepath = false
[pretty]
log = %Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%ci) %C(bold blue)<%an>%Creset
reflog = %C(auto)%h %<|(20)%gd %C(blue)%cd%C(reset) %gs (%s)
[gui]
spellingdictionary = none
encoding = utf-8
fontui = -family \"Droid Sans Mono\" -size -12 -weight normal -slant roman -underline 0 -overstrike 0
fontdiff = -family \"Droid Sans Mono\" -size -12 -weight normal -slant roman -underline 0 -overstrike 0
[i18n]
commitencoding = utf-8
[svn]
pathnameencoding = utf-8
[push]
default = simple
[color]
ui = true
diff = true
[http]
postBuffer = 524288000
sslVerify = false
[difftool "vscode"]
cmd = opendiff \"$LOCAL\" \"$REMOTE\"
path =
[diff]
tool = Kaleidoscope
[mergetool "sourcetree"]
cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
trustExitCode = true
[commit]
template = /Users/linwei/.stCommitMsg
[mergetool "Kaleidoscope"]
cmd = ksdiff --merge --output \"$MERGED\" --base \"$BASE\" -- \"$LOCAL\" --snapshot \"$REMOTE\" --snapshot
trustexitcode = true
[mergetool "studio"]
cmd = studio merge $(cd $(dirname "$LOCAL") && pwd)/$(basename "$LOCAL") $(cd $(dirname "$REMOTE") && pwd)/$(basename "$REMOTE") $(cd $(dirname "$BASE") && pwd)/$(basename "$BASE") $(cd $(dirname "$MERGED") && pwd)/$(basename "$MERGED")
trustExitCode = true
[merge]
tool = Kaleidoscope
[difftool "Kaleidoscope"]
cmd = ksdiff --partial-changeset --relative-path \"$MERGED\" -- \"$LOCAL\" \"$REMOTE\"
[difftool]
prompt = false
[mergetool]
prompt = false
keepBackup = false
[mergetool "vscode"]
cmd = code --wait $MERGED
[difftool "vscode"]
cmd = code --wait --diff $LOCAL $REMOTE
[credential]
helper = store
[apply]
whitespace = nowarn
[submodule]
; recurse = true
[status]
; submoduleSummary = true
[filter "lfs"]
clean = git-lfs clean -- %f
smudge = git-lfs smudge -- %f
process = git-lfs filter-process
required = true
[rerere]
enabled = true
[oh-my-zsh]
hide-dirty = 1 #speed zsh
hide-status = 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment