git config¶
Open config in editor¶
Git config for current repo is not always in .git/config
(e.g. when using submodules).
Commands¶
- Show config origin files:
git config --list --show-origin
diff gpg¶
Update .gitattributes
in repo:
echo "*.gpg filter=gpg diff=gpg" >> .gitattributes
echo "*.asc filter=gpg diff=gpg" >> .gitattributes
Tell Git to decrypt GPG files before diff'ing them (use --local
for current repo only):
Don't ask me to run git push --set-upstream origin
. Rather than ask me where to push new branches:
Disable gpg signing for current repo¶
Override $EDITOR for commits¶
Don't use code
for commits.
Global user config¶
--global
For writing options: write to global ~/.gitconfig
file rather than the repository .git/config
, write to $XDG_CONFIG_HOME/git/config
file if this file exists and the ~/.gitconfig
file doesn’t.
For reading options: read only from global ~/.gitconfig
and from $XDG_CONFIG_HOME/git/config
rather than from all available files.