Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

The following command:

$git config --global --list

gives me:

user.name=test user

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

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.

share|improve this question

3 Answers 3

up vote 27 down vote accepted

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

share|improve this answer
Thanks, that works, but is there a way to edit it using commands too? –  gotqn Oct 26 '12 at 6:10
@gotqn you can use cat or gedit to edit that. –  Sanjaya Pandey Aug 15 '13 at 7:29
@gotqn gedit ~/.gitconfig OR nano ~/.gitconfig –  Giri Feb 22 '14 at 21:41
@Giri or you could use vim... or ex or ed or butterflies that focus the cosmic energy in the upper atmosphere that then flip the correct bits in your drive platter. –  dylnmc Oct 31 '14 at 17:04

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>
share|improve this answer
can't edit only a single symbol, so: --unset-all (with double-dash) is the correct answer. +1 –  donSchoe May 3 '13 at 9:43
@qdoe I updated the answer properly. –  thefourtheye Aug 17 '13 at 9:49
I think this is the best answer. Since the configuration is already made via command line, I think the reverse operation should be done via command line. Otherwise do all configuration in the config file. –  Johan Karlsson Sep 4 '14 at 9:56
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"
share|improve this answer
This answer was essentially already provided in the question by user25327. I think the addition of the --replace-all option should be a comment. –  gertvdijk Jun 26 '13 at 8:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.