I was exploring the git config
options using tab completion in bash, and without really thinking, I did this:
git config --global user.signingkey --help
and now my global signing key is set to --help
. Facepalm. Is there a generic way to find out what these config settings where in the past, or is there somewhere that I could look in a project to see what this might have been set to? I have a Github account, maybe I could get the old value from there, since I haven't pushed anything since the mistake? I'm not even sure if it was set to anything, but I do use SSH with Github.
cd <another project's location>; git config user.signingkey
returns --help
.
The global git config is simply a text file, so it can be edited with whatever text editor you choose. Open, edit global git config, save and close, and the changes will take effect the next time you issue a git command. It's that easy.
Summary. To review, git reset is a powerful command that is used to undo local changes to the state of a Git repo. Git reset operates on "The Three Trees of Git". These trees are the Commit History ( HEAD ), the Staging Index, and the Working Directory.
Command
git config --global section.key value
does nothing more than editing file ~/.gitconfig
with content like this:
[section] key = value
So, you can simply edit this file and fix it.
Also, you can use command to remove offending setting:
git config --global --unset section.key
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With