Git Configuration
Git configuration exists at multiple levels: system, global, and local repository configuration. Local repository configuration has higher precedence than global configuration.
Common configuration includes user identity, default branch name, editor, aliases, and pull behavior.
Configure Git Identity
git config --global user.name "Suriya"
git config --global user.email "developer@example.com"
git config --global init.defaultBranch main
git config --list --show-origin💡 Global configuration applies to repositories for the current user. Repository-local configuration can override global settings.
Key Takeaways
- Git configuration can exist at multiple scopes.
- Local repository configuration can override global settings.
- Use
--show-originto understand where a configuration value came from.
Knowledge Check
Which configuration generally has higher precedence: local repository configuration or global configuration?