Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble setting up Tower with my GitHub Account - error: could not lock config file

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
like image 773
joshferrara Avatar asked Apr 26 '12 20:04

joshferrara


2 Answers

I was facing the same issue. I renamed my .gitconfig file to "xyz.gitconfig" And I found that git created a new .gitconfig file. I was not facing the error anymore.

like image 71
DolphinJava Avatar answered Sep 18 '22 19:09

DolphinJava


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)
like image 26
joshferrara Avatar answered Sep 17 '22 19:09

joshferrara