How can I remove an entry in global configuration with git config?

前端 未结 7 1772
不思量自难忘°
不思量自难忘° 2020-11-28 17:51

I ran a global configuration command in git to exclude certain files using a .gitignore_global file:

git config --global core.excludesfile ~/.gitignore_globa         


        
相关标签:
7条回答
  • 2020-11-28 17:52

    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.

    0 讨论(0)
  • 2020-11-28 17:53

    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"
    
    0 讨论(0)
  • 2020-11-28 17:53

    Open config file to edit :

    git config --global --edit
    

    Press Insert and remove the setting

    and finally type :wq and Enter to save.

    0 讨论(0)
  • 2020-11-28 18:01

    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.

    0 讨论(0)
  • 2020-11-28 18:11

    You can edit the ~/.gitconfig file in your home folder. This is where all --global settings are saved.

    0 讨论(0)
  • 2020-11-28 18:12

    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 
    
    0 讨论(0)
提交回复
热议问题