问题
C:\Users\Inspiron\.git\config
folder is empty and command $git config user.email user@gmail.com
returns error: opening .git/config: permission denied.
I try to set post buffer size,but get same error.
回答1:
Thats not a folder its the main configuration file for git.
Here you can see the files for configuration
http://git-scm.com/docs/git-config
Permission denied under windows its a bit strange. Check the permissions of the file. Perhaps you have removed the Permissions in the extended permissions.
回答2:
I'm pretty sure it's not supposed to be a folder. Delete it and let git create it.
回答3:
Check Windows Security Properties
On Windows 7, I was only able to fix this by right clicking on the file in explorer, clicking properties/security tab/advanced/permissions and removing the 'deny' permission type. chmod and chown did nothing for me.
回答4:
Not only .git/config
is a file, but its permission must soon (Git 2.0.X/2.1, Q3 2014) not include "world writable".
See commit daa22c6 by Eric Wong
config
: preserve config file permissions on edits
Users may already store sensitive data such as
imap.pass
in.git/config
; making the file world-readable when "git config
" is called to edit means their password would be compromised on a shared system.
回答5:
On Windows 10, I was only able to fix this by right clicking on the file in Explorer, enter the path of config file (C:\ProgramData\Git
), right clicking on config file properties/security
, tab "advanced/permissions" and give full access to LogonSessionId_0_XXXXXXX (NT AUTHORITY)
.
来源:https://stackoverflow.com/questions/23143397/opening-git-config-permission-denied