I am working with 2 projects in same time. One is for my work and another is my personal project. I'd like to use git as version control software.
I have configured .gitconfig under my my directory as follows.
1 [user]
2 name = gladder
3 email = gladder
So git can pickup my user settings automatically. however, I am just wondering that is it possible to get this setting in small scope开发者_Go百科?
So the project's user settings can override global user settings.
Yes, all the settings that are in $HOME/.gitconfig
can be put into .git/config
inside each repository.
You can use the --file
flag with git config
(or not as it is the default):
git config --file user.name gladder
git config --file user.email gladder
which will create/set the value in project/.git/config
(as araqnid said)
Refer to git-config for more information.
精彩评论