5

I installed Git in the following way:

 sudo apt-get install git    
# add-apt-repository ppa:git-core/ppa 
# apt update; apt install git

Install in root, but with sudo. The command I use is:

git config global user.name

But it's all in the same partition, which are the following:

sda1 vfat      543B-94D1    /boot/efi    977M root  disk  brw-rw----
sda2 ext4   5b5eb118-5ba4-409a-82ee-6526a13554ae /boot    977M root  disk  brw-rw----
sda3 swap   36aa7937-43db-4445-808b-9e8717d01daf [SWAP]   15,3G root disk  brw-rw----
sda4 ext4   27e1d5a1-4204-43b9-abcc-2c2f2de33c9e /  142G root  disk  brw-rw----
sda5 ext4    7da1ca1c-faa7-402a-b669-b2561ebd249c /home   772,4G root  disk  brw-rw----

But I have everything in the same partition: Next, I try to configure Git locally with my data, but I get an error:

fatal: not in a git directory

How I should proceed ? Why do I have that error? Thank you.

muru
  • 197,895
  • 55
  • 485
  • 740
gemita
  • 215

1 Answers1

5

global is a flag, so the command you tried to run should be like this instead:

git config --global user.name

So if you want to configure your username and email, you need to run the following commands

git config --global user.email "bob@google.com"
git config --global user.name "Bob Saget"