The git push displays an error.

Asked 2 years ago, Updated 2 years ago, 39 views

git push showed an error and I couldn't find the cause and solution, so I came back here again

The error occurs locally when pushing remotely from the local repository in virtualbox.The remote is a bare repository of github and sakura rental servers.

error:update_ref failed for ref'refs/remotes/origin/master':cannot lock ref'refs/remotes/origin/master':Unable to create'/var/www/html/xxxx/.git/refs/remotes/origin/master.lock':???

I can push it remotely with git push, but I see this error.

Previously, the ??? part was permission denied, but after I upgraded the git version, it changed to ? (removed 1.7 from yum installation and 2.7 from manual installation)

Also, there is a file called master, but I can't find a file called master.lock even if I look at it on winspc.

You can push from the local repository to two remote repositories at once.
One is github's private repository

The other is to create a bare repository in the Sakura server by referring to the following site and pull it in a non-bare repository (directory for production publication).
Create a repository that automatically updates the website when pushed to the remote repository of Git

For more information, I would like to ask you a question that you helped me build.
I want to push from git to multiple remote repositories

Try apache for administrators below .git

in .git/refs/remotes/origin/master Try setting the permission to 777
I did, but there was no change.

Did you search various things and it was added to the config file during git push-u origin master?I wonder if the following is relevant...
I think so, but I couldn't think of the first step.

 [ branch "master" ]
        remote=origin
        merge=refs/heads/master

I hope I can get your advice again.
Thank you for your cooperation.

git

2022-09-29 22:14

1 Answers

.git I tried apache and 777 as the owner of the file below, and the error disappeared.

(From Comment of Questioner)


2022-09-29 22:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.