tldr/pages/common/git-config.md

29 lines
794 B
Markdown
Raw Normal View History

2015-12-17 10:09:03 +00:00
# git config
> 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
- 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`
- List only global configuration entries (stored in `~/.gitconfig`):
2015-12-17 10:09:03 +00:00
`git config --list --global`
- List all configuration entries that have been defined either locally or globally:
2015-12-17 10:09:03 +00:00
`git config --list`
- Get the value of a given configuration entry:
2015-12-17 10:09:03 +00:00
`git config alias.unstage`
2015-12-17 10:09:03 +00:00
- Set the global value of a given configuration entry:
2015-12-17 10:09:03 +00:00
`git config --global alias.unstage "reset HEAD --"`
2015-12-17 10:09:03 +00:00
- Revert a global configuration entry to its default value:
2015-12-17 10:09:03 +00:00
`git config --global --unset alias.unstage`