本文介绍了用我的GitHub账号设置Tower时出错 - 错误:无法锁定配置文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在使用GitHub for Mac应用程序,但根据朋友的建议,决定给Tower一个镜头,因为它也可以处理Beanstalk帐户。



在安装试用版并放入我的GitHub用户名和密码后,我收到了以下错误消息:

 错误:无法锁定配置文件/Users/joshferrara/.gitconfig:权限被拒绝

我只是好奇,如果有人知道是什么原因造成的,或者它与我使用Tower有什么关系。任何帮助非常感谢!






文件权限:

  -rw-rw-rw- 1 joshferrara staff 130 Nov 22 17:14 /Users/joshferrara/.gitconfig 

对父目录的权限:

  drwxr-xr-x 74 501 staff 2516 Apr 26 14:46 / Users / joshferrara 


解决方案

事实证明,Github for Mac为root权限创建的 .gitconfig 文件与Tower无法访问之间存在奇怪的权限问题。

通过简单更改所有者权限可以解决问题。所有权可以像这样改变:

  sudo chown -R用户名[文件|目录] 



  • sudo - 授予root权限

  • chown - 更改所有权
  • -R - 用于文件递归更改
  • 用户名 - 用户名新的所有者

  • [文件|目录] - 要更改的文件或目录(如果指定了目录,它将递归更改所有文件里面)


I've been using the GitHub for Mac app but on the suggestion of a friend, decided to give Tower a shot since it can also handle Beanstalk accounts as well.

After installing the trial and putting in my GitHub username and password, I'm given this error:

error: could not lock config file /Users/joshferrara/.gitconfig: Permission denied

I was just curious if anyone knows what's causing this or if it has any relevance to me using Tower. Any help is greatly appreciated!


Permissions on the file:

-rw-rw-rw- 1 joshferrara staff 130 Nov 22 17:14 /Users/joshferrara/.gitconfig

Permissions on the parent directory:

drwxr-xr-x 74 501 staff 2516 Apr 26 14:46 /Users/joshferrara
解决方案

It turned out to be an odd permission issue between the .gitconfig file that Github for Mac created with root privileges and Tower wasn't able to access.

A simple change of ownership privileges fixed the problem. Ownership can be changed like so:

sudo chown -R username [file|directory]

Explanation:

  • sudo - grant root privileges
  • chown - changes the ownership
  • -R - for recursive changing of files
  • username - username of new owner
  • [file|directory] - file or directory for change to occur (if directory is specified it's going to recursively change all the files inside)

这篇关于用我的GitHub账号设置Tower时出错 - 错误:无法锁定配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 11:45