简体   繁体   中英

permission denied trying to set global git config

in visual code terminal, I am trying to create user account with the command git config --global user.name "Tari shah" , but I am keep getting the error

error: could not lock config file C:/WINDOWS/system32/config/systemprofile/.gitconfig: Permission denied".

please let me know how to resolve this issue.

That looks like VSCode was launch with the System account or Administrator account, but not your own Windows account.

Try the same command in a regular CMD session, opened regularely (not as admin): it should write in %USERPROFILE%\.gitconfig .
You can see that with (using Git 2.27):

git config -l --show-origin --show-scope

So try and re-launch your VSCode from your Windows account.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM