简体   繁体   English

gitconfig错误Mac OS X 10.10

[英]gitconfig error mac OS X 10.10

I'm trying to setup the global config settings for my git installation and when I run the command 我正在尝试为git安装和运行命令设置全局配置设置

git config —global user.name “myname”

I get the following error msg: 我收到以下错误消息:

error: could not lock config file /Users/vc/.gitconfig: No such file
or directory

my git version on my mac git version 1.9.3 (Apple Git-50) 我的Mac git version 1.9.3 (Apple Git-50)上的git version 1.9.3 (Apple Git-50)

How can I fix this error? 如何解决此错误?

I found the solution on the following site: 我在以下站点上找到了解决方案:

http://coolestguidesontheplanet.com/install-update-latest-version-git-mac-osx-10-9-mavericks/ http://coolestguidesontheplanet.com/install-update-latest-version-git-mac-osx-10-9-mavericks/

Under the article, but before you do that, please delete any gui based git installation and then download the latest version of git and follow the instructions below under the title. 在文章下,但在执行此操作之前,请删除所有基于gui的git安装,然后下载最新版本的git,并按照标题下的以下说明进行操作。

Trumping Xcodes Older Git 吹嘘Xcodes老Git

If you have Xcode already installed and have installed command line tools then you alreay have Git, probably an older version which is distributed with Xcode this is installed in: 如果您已经安装了Xcode并且已经安装了命令行工具,那么您确实拥有Git,它可能是随Xcode一起分发的较旧版本,它安装在以下位置:

/usr/local/bin To run the lastest version you need to adjust your shell path: / usr / local / bin要运行最新版本,需要调整外壳路径:

/usr/local/git/bin/git You need to add add the above path to the beginning of your shell path to take precedence over the other path, the path will be set in either .bashrc or .bash_profile in your home directory. / usr / local / git / bin / git您需要在shell路径的开头添加上述路径,以优先于其他路径,该路径将在主目录中的.bashrc或.bash_profile中设置。

So add in 所以添加

/usr/local/git/bin to the path similar to the below: / usr / local / git / bin到类似于下面的路径:

export PATH="/usr/local/git/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:$PATH" 导出PATH =“ / usr / local / git / bin:/ usr / local / bin:/ usr / bin:/ usr / local / sbin:$ PATH”

Restart or reload the Terminal and the newer Git version will now be used. 重新启动或重新加载终端,现在将使用较新的Git版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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