There are 3 places where we can set git config:
- /etc/gitconfig
This is globe config. Write and read its settings:
git config --system ...
- $HOME/.gitconfig or $HOME/.config/git/config
This config is for current user.
git config --global ...
- .git/config
This config is just for current repository. You can run the following command under a repository:
git config ...
For example, we usually set after install git as follows:
git config --global user.name "Henry"
git config --global user.email "[email protected]"
Check one config:
git config user.name
Henry
Check all config:
git config --list
alias.ci=commit
user.name=Henry
[email protected]
alias.st=status
alias.ci=commit
color.ui=true
push.default=simple
core.editor=vi
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
[email protected]:henryhu712/zdoc.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master