Reputation: 44952
I ran a global configuration command in git to exclude certain files using a .gitignore_global
file:
git config --global core.excludesfile ~/.gitignore_global
Is there a way to undo the creation of this setting globally?
Upvotes: 696
Views: 908529
Reputation: 67
Im on Windows. In my case, I set the path using backslashes which confused git. I replaced them with forward slashes using git config --global --edit
Upvotes: 2
Reputation: 6764
Try this from the command line to change the git config details.
git config --global --replace-all user.name "Your New Name"
git config --global --replace-all user.email "Your new email"
Upvotes: 34
Reputation: 311
This would unset global credential helper.
git config --global --unset credential.helper
Upvotes: 19
Reputation: 789
In order to complement the larsk anwser, is possible remove an entry line while editing with vim using the dd command:
git config --global --edit
then:
dd
and hit Enter to remove the line.when you finish, type ESQ
and :wq
Upvotes: 30
Reputation: 590
If someone just wanna delete the user
object entirely, then he should use:
git config --global --remove-section user
This is useful when a user accidentally adds more properties that are not required just like user.password
etc.
Upvotes: 11
Reputation: 5600
Try these commands to remove all users' usernames and emails.
git config --global --unset-all user.name
git config --global --unset-all user.email
Upvotes: 21
Reputation: 915
Open config file to edit :
git config --global --edit
Press Insert and remove the setting
and finally type :wq
and Enter to save.
Upvotes: 54
Reputation: 2801
You can check all the config settings using
git config --global --list
You can remove the setting for example username
git config --global --unset user.name
You can edit the configuration or remove the config setting manually by hand using:
git config --global --edit
Upvotes: 30
Reputation: 71
git config information will stored in ~/.gitconfig
in unix platform.
In Windows it will be stored in C:/users/<NAME>/.gitconfig.
You can edit it manually by opening this files and deleting the fields which you are interested.
Upvotes: 6
Reputation: 978
You can edit the ~/.gitconfig
file in your home folder. This is where all --global
settings are saved.
Upvotes: 7
Reputation: 1459
You can use the --unset
flag of git config
to do this like so:
git config --global --unset user.name
git config --global --unset user.email
If you have more variables for one config you can use:
git config --global --unset-all user.name
Upvotes: 145
Reputation: 312400
I'm not sure what you mean by "undo" the change. You can remove the core.excludesfile
setting like this:
git config --global --unset core.excludesfile
And of course you can simply edit the config file:
git config --global --edit
...and then remove the setting by hand.
Upvotes: 1196