I have a git repository linked to a dropbox folder. Recently, I have switched my laptop to another, and now i can not perform the function \"git commit -am\". I keep getting
I had same issue, here the steps , how I solved the issue.
1) first checked the file permission( and found, only root having access )
$ls -l .git/COMMIT_EDITMSG
-rw-r--r-- 1 root root 13 Jun 11 07:54 .git/COMMIT_EDITMSG
2) logged in as root and changed file permission
# chown arun:arun .git/COMMIT_EDITMSG
( here arun
is my username, refer chown
command for more details )
3) Now file permission changed and able to commit without any issues !
$ls -l .git/COMMIT_EDITMSG
-rw-r--r-- 1 arun arun 12 Jun 16 11:47 .git/COMMIT_EDITMSG
This is an file permission issue, user you are currently logged on does not have permissions to use the files.
If that's your repo, you may try:
sudo chown youruser -R yourrepodir/
)chmod
(you should avoid using 0777
as it is not secure)I had this issue when I had a git repo inside a git repo in a working copy.. hope that helps
Ensure that the git app you use (whether GUI, cmd or bash) is running as an Administrator. This of course apply if you are using Windows.
try this git init --shared=0777
Assuming you're on a Windows machine, the chances are that you modified a hidden file and no longer have write permissions to the hidden file.
To solve this, simply navigate to your .git folder and delete the "COMMIT_EDITMSG" file.