Ubuntu: git config global file - remove settings



Question:

The following command:

$git config --global --list  

gives me:

user.name=test user  user.name=gotqn  

I want to remove the first name. I refers to this article and do the following commands but without any result:

git config --global --remove-section user.name='test user'  git config --global --remove-section user.name="test user"  git config --global --remove-section user.name=test user  git config --global --remove-section user.name  git config --global --remove-section test user  

I am using Ubuntu 12.04 and

git version  

gives me

git version 1.7.9.5  

Please, help on this, because I want to try to save my project using git, but do not want to exec the command with 'test user' name.


Solution:1

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


Solution:2

Super late answer, but hopefully still helpful:

git config --global --unset-all user.name  

Then you're free to:

git config --global --add user.name <whatever>  


Solution:3

git config --global --unset-all user.name  

Or you can just change the user name like this:

git config --global --replace-all user.name "New User Name"  


Solution:4

Last but not least usefull, although it's a marginal case is to use

git config --global --remove-section user  

In my case it cleared the data perfectly and with little to no effort


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »