helsonlin
helsonlin
发布于 2024-12-18 / 22 阅读
0
0

不同目录配置不同 git user

[user]
	name = user1
	email =

[includeIf "gitdir:/Users/lin/ifly/"]
	path = /Users/lin/.gitconfig-works

[includeIf "gitdir:/Users/lin/person/"]
	path = /Users/lin/.gitconfig-codes
 
[core]
	excludesfile = /Users/lin/.gitignore_global
[difftool "sourcetree"]
	cmd = opendiff \"$LOCAL\" \"$REMOTE\"
	path = 
[mergetool "sourcetree"]
	cmd = /Applications/Sourcetree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
	trustExitCode = true

注意:includeIf里面的目录地址需要在最后追加"/"才可以。

测试,在项目目录下执行:`git config --show-origin --get user.name`


评论