

0 / 2 embers
0 / 3000 xp
click for more info
Complete a lesson to start your streak
click for more info
Difficulty: 5
click for more info
Not enough gems
Cost: 6 gems
1: Git Config
incomplete
2: Get
incomplete
3: Unset
incomplete
4: Duplicates
incomplete
5: Remove a Section
incomplete
6: Locations
incomplete
This lesson's interactive features are locked, please to keep using them
There are several locations where Git can be configured. From more general to more specific, they are:
/etc/gitconfig, a file that configures Git for all users on the system~/.gitconfig, a file that configures Git for all projects of a user.git/config, a file that configures Git for a specific project.git/config.worktree, a file that configures Git for part of a projectIn my experience, 90% of the time you will be using --global to set things like your username and email. The other 9% of the time you will be using --local to set project-specific configurations. The last 1% of the time you might need to futz with system and worktree configurations, but it's extremely rare.
If you set a configuration in a more specific location, it will override the same configuration in a more general location. For example, if you set user.name in the local configuration, it will override the user.name set in the global configuration.