2015-12-17 10:09:03 +00:00
|
|
|
# git config
|
|
|
|
|
2017-06-15 23:30:21 +01:00
|
|
|
> Manage custom configuration options for git repositories.
|
|
|
|
> These configurations can be local (for the current repository) or global (for the current user).
|
2015-12-17 10:09:03 +00:00
|
|
|
|
2017-06-15 23:30:21 +01:00
|
|
|
- List only local configuration entries (stored in `.git/config` in the current repository):
|
2015-12-17 10:09:03 +00:00
|
|
|
|
|
|
|
`git config --list --local`
|
|
|
|
|
2017-06-15 23:30:21 +01:00
|
|
|
- List only global configuration entries (stored in `~/.gitconfig`):
|
2015-12-17 10:09:03 +00:00
|
|
|
|
|
|
|
`git config --list --global`
|
|
|
|
|
2017-06-15 23:30:21 +01:00
|
|
|
- List all configuration entries that have been defined either locally or globally:
|
2015-12-17 10:09:03 +00:00
|
|
|
|
|
|
|
`git config --list`
|
|
|
|
|
2017-06-15 23:30:21 +01:00
|
|
|
- Get the value of a given configuration entry:
|
2015-12-17 10:09:03 +00:00
|
|
|
|
2017-06-15 23:30:21 +01:00
|
|
|
`git config alias.unstage`
|
2015-12-17 10:09:03 +00:00
|
|
|
|
2017-06-15 23:30:21 +01:00
|
|
|
- Set the global value of a given configuration entry:
|
2015-12-17 10:09:03 +00:00
|
|
|
|
2017-06-15 23:30:21 +01:00
|
|
|
`git config --global alias.unstage "reset HEAD --"`
|
2015-12-17 10:09:03 +00:00
|
|
|
|
2017-06-15 23:30:21 +01:00
|
|
|
- Revert a global configuration entry to its default value:
|
2015-12-17 10:09:03 +00:00
|
|
|
|
2017-06-15 23:30:21 +01:00
|
|
|
`git config --global --unset alias.unstage`
|