Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git-config: update page #15557

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions pages/common/git-config.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@

`git config --global {{user.name|user.email}} "{{Your Name|[email protected]}}"`

- List local or global configuration entries:
- List local, global or system configuration entries and show their file location:

`git config --list --{{local|global}}`
`git config --list --{{local|global|system}} --show-origin`

- List only system configuration entries (stored in `/etc/gitconfig`), and show their file location:
- Set the global value of a given configuration entry (in this case an alias):

`git config --list --system --show-origin`
`git config --global {{alias.unstage}} "reset HEAD --"`

- Get the value of a given configuration entry:

`git config alias.unstage`
`git config {{alias.unstage}}`

- Set the global value of a given configuration entry:
- Use an alias:

`git config --global alias.unstage "reset HEAD --"`
`git {{unstage}}`

- Revert a global configuration entry to its default value:

`git config --global --unset alias.unstage`
`git config --global --unset {{alias.unstage}}`

- Edit the local Git configuration (`.git/config`) in the default editor:

Expand Down
Loading