Reputation: 65
After some trial and error I was able to change the permissions of the .gitconfig
file in my local users /home/
directory. This permission change allowed me to add both user.name
and user.email
. I apologize if this wasted anyone's time and I do appreciate all of the help. Specifically @phd, @jD3V and @VonC
I am really banging my head against my desk with this one.
I have a remote GitHub repo that I have cloned locally to my machine and I am making edits to the playbook. When I go to commit the changes to GitHub VSCode throws an error:
*** Please tell me who you are.
Run
git config --global user.email "[email protected]"
git config --global user.name "Your Name"
to set your account's default identity.
Omit --global to set the identity only in this repository.
fatal: no email was given and auto-detection is disabled
[2022-04-23T18:08:35.512Z] > git config --get-all user.name [1ms]
I have run into this issue before, no big deal. This is a fresh install of Pop!_OS so I had not yet edited my git config. I enter the following -
git config --global user.name My_GitHub_Username
Followed by -
git config --global user.email [email protected]
When entered they both seem to run correctly as I do not get any errors thrown when entered. However when I check the git config
with git config --list
nothing returns in the terminal. When I run it again running as root, I see my username -
username@pop-os:~$ sudo git config --list
user.name=My_GitHub_username
[email protected]
Trying to commit the code again throws the same error. I have checked similar threads/solutions here, here and here, all of which have not solved my issue.
I forgot to include initially that I have tried running both as sudo
and have the same results. Here is the output of `sudo nano ~/.gitconfig -
[alias]
lg1 = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"
[color]
ui = true
[help]
autocorrect = 3
Would I just go ahead and add the [user]
alias with the user.name
and user.email
options filled in?
Any ideas what I might be doing incorrectly? I am not super familiar with git but would love any and all advice.
Upvotes: 0
Views: 1334
Reputation: 1329082
To exand on the comment, git config --global
do modify ~/.gitconfig
, which is /home/<you>/.gitconfig
.
That differs from sudo xxx
, which executes command as root.
root
home folder is /root
.
And /root/.gitconfig
was not modified by your initial git config
commands.
In general, not using root
, is possible, is a sensible route to follow.
Upvotes: 2