Hızlı yanıt: kod örneği
Git comes with a tool called that lets you configure variables that control all the aspects of how git will operate. holds its value between upgrades. So, you need to set it only once.Basically, there are 3 places to store these variables:.
Example: You can make git read and write from System by passing as option. It also requires you to have administration permissions.2. Global: Global configurations are available for the current user for all the projects and stored in or
Example: You can make git to read and write from Global by passing option.3. Local: Local configs are available for the current repository only and stored in
Example: You can make git read and write from Local by passing option.Example:to verify the origin of your configuration :Also, its important to remember each level overrides values the previous level.Priority:Local > Global > System
git config
git config
- System.
- Global.
- Local.
[path]/etc/gitconfig
C:/Program Files/Git/etc/gitconfig
--system
~/.gitconfig
~/.config/git/config
C:/Users/Username/.gitconfig
--global
[gitrepo]/.git/config
C:/Users/MyProject/.git/config
--local
Create a local config$ git config --local user.name "Local User"# Create a global config$ git config --global user.name "Global User"# Create a system config$ sudo git config --system user.name "System User"
git config --list --show-origin