Git Bash 配置时 error: could not lock config file Java/jdk1.7.0_71/.gitconfig: Permission denied
2017-04-19 00:00
1361 查看
摘要: 第一次使用git,跟教程刚刚走到git config --global color.diff auto的时候就出错走不下去了,凭直觉去尝试解决,结果真的解决了!
版权声明:本文为博主原创文章,未经博主允许不得转载。
今天第一次装Git,按照教程配置的时候出现
经过几次尝试,得出解决办法:
找到Git安装目录,设置git-bash.exe的属性,在兼容性属性页勾上“以管理员身份运行此程序”即可。
我是分割线
下面记录一下当时的历程:
刚遇到这个问题的时候,猜测是git需要管理员权限,于是就which了一下git,看看git是在哪里
然后把/mingw64/bin/git.exe的属性加上了管理员权限。天真的以为就这样解决了,可是结果却是:
于是想到应该是调用git.exe的程序需要管理员权限。可是由谁来调用的git.exe呢?又尝试修改了/cmd/git.exe,/bin/bash.exe,/bin/git.exe的权限,仍然报相同错误。
就在山重水复疑无路的时候,猛然发现Git根目录下就有个git-bash.exe,眼前一亮,修改了git-bash.exe的权限,发现问题解决了!然后去掉前面多余设置的权限之后仍然没有任何问题。
总结出仅需设置git-bash.exe的权限即可。
第一次写帖子,还请各位大神指点!
版权声明:本文为博主原创文章,未经博主允许不得转载。
今天第一次装Git,按照教程配置的时候出现
$ git config --global color.diff auto error: could not lock config file C:/Program Files/Java/jdk1.7.0_71/.gitconfig: Permission denied
经过几次尝试,得出解决办法:
找到Git安装目录,设置git-bash.exe的属性,在兼容性属性页勾上“以管理员身份运行此程序”即可。
我是分割线
下面记录一下当时的历程:
刚遇到这个问题的时候,猜测是git需要管理员权限,于是就which了一下git,看看git是在哪里
$ which git /mingw64/bin/git
然后把/mingw64/bin/git.exe的属性加上了管理员权限。天真的以为就这样解决了,可是结果却是:
$ git config --global color.diff auto bash: /mingw64/bin/git: Permission denied
于是想到应该是调用git.exe的程序需要管理员权限。可是由谁来调用的git.exe呢?又尝试修改了/cmd/git.exe,/bin/bash.exe,/bin/git.exe的权限,仍然报相同错误。
就在山重水复疑无路的时候,猛然发现Git根目录下就有个git-bash.exe,眼前一亮,修改了git-bash.exe的权限,发现问题解决了!然后去掉前面多余设置的权限之后仍然没有任何问题。
总结出仅需设置git-bash.exe的权限即可。
第一次写帖子,还请各位大神指点!
相关文章推荐
- [已解决]brew update出错:error: could not lock config file .git/config: Permission denied
- error: could not lock config file E:/git/Git/%USERPROFILE%/.gitconfig: No such file or directory
- Git 出现的 error: could not lock config file H:\/.gitconfig
- git创建:error: could not lock config file
- error: could not lock config file .git/config: 权限不够
- Error: Could not open input file: /usr/java/jdk1.7.0_07/jre/lib/jsse.pack
- Git 删除远程分支报错 error: Could not remove config section 'remote.origin' 解决办法
- [ERROR] Could not create unix socket lock file /var/run/mysql/mysql.sock.lock
- 安装JDK后,运行java命令出现错误Error:could not open ...jvm.cfg
- solve the error : Could not open lock file /var/lib/apt/lists/lock
- 彻底删除jdk并重装jdk和配置环境变量设置后Error: could not open `F:\Java\jre7\lib\jvm.cfg
- pip install pycurl "Error: Could not run curl-config: [Errno 2] No such file or directory"
- 编译android内核和文件系统,已经安装jdk,提示build/core/config.mk:268: *** Error: could not find jdk tools.jar
- 关于JNI配置Error: Could not find class file for 'XXX'问题(MAC Andriod Studio)
- win10下JDK安装,配置环境变量后报Error: could not open `C:\Program Files\Java\jre1.8.0_112\lib\amd64\jvm.cfg'
- Hadoop 2.7 伪分布式安装配置 Error: JAVA_HOME is not set and could not be found.
- erlang 读取confg文件异常 could not start kernel pid error in config file
- 安装 pyspider ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory
- java jre jdk 下载区别 以及环境变量配置(Error:could not open jvm.cfg 问题解决方案亲自测