-
Notifications
You must be signed in to change notification settings - Fork 2k
+config paths for Debian, & +command to view all configs #1129
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
Conversation
The config paths as they were didn't work for me on Debian Stretch. So added paths for them. Also added a command to show all current settings and where they're coming from. Ref: https://stackoverflow.com/questions/2114111/where-does-git-config-global-get-written-to Also paralleled text for 3 items, and bold faced heading for Windows.
These variables can be stored in three different places: | ||
|
||
1. `/etc/gitconfig` file: Contains values applied to every user on the system and all their repositories. | ||
1. `/etc/gitconfig` (/usr/local/etc/gitconfig on Debian): Contains values applied to every user on the system and all their repositories. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utterly false, Debian is no different:
$ sudo /usr/bin/git config --system --add foo.bar foo
$ cat /etc/gitconfig
[foo]
bar = foo
If you pass the option `--system` to `git config`, it reads and writes from this file specifically. | ||
(Because this is a system configuration file, you would need administrative or superuser privilege to make changes to it.) | ||
2. `~/.gitconfig` or `~/.config/git/config` file: Values specific personally to you, the user. | ||
2. `~/.gitconfig` or `~/.config/git/config` (note ~ is root's home dir): Contains values specific personally to you, the user. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only if the current user is root
(which should not happen), otherwise, it's current user's home dir.
$sudo git config --list --show-origin | ||
---- | ||
|
||
*Windows:* Git looks for the `.gitconfig` file in the `$HOME` directory (`C:\Users\$USER` for most people). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The same as for Linux users, so I guess it's useless to specify the case of Windows.
[source,console] | ||
---- | ||
$sudo git config --list --show-origin | ||
---- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
|
||
[source,console] | ||
---- | ||
$sudo git config --list --show-origin |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
git config
need not to be run with su privileges.
The config paths as they were didn't work for me on Debian Stretch. So added paths for them.
Also added a command to show all current settings and where they're coming from. Ref: https://stackoverflow.com/questions/2114111/where-does-git-config-global-get-written-to
Also paralleled text for 3 items, and bold faced heading for Windows.