1

I have created a new branch in my local repository and after some commits, I wanted to push it to the remote repository.

git push origin new_branch

The last month I did something similar (to push a new branch) and I never had a problem before, but now I have this error:

Counting objects: 39, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (23/23), done.
Writing objects: 100% (23/23), 14.30 KiB, done.
Total 23 (delta 16), reused 0 (delta 0)
Unpacking objects: 100% (23/23), done.
fatal: Unable to create '/mnt/server.Annax/git/voipsrv_anxsvn/.git/refs/heads/new_branch.lock': Permission denied
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

Can anybody help me, please?

Alicia R.
  • 53
  • 1
  • 5
  • Possible duplicate of [The remote end hung up unexpectedly while git cloning](https://stackoverflow.com/questions/6842687/the-remote-end-hung-up-unexpectedly-while-git-cloning) – NickCoder Jul 13 '19 at 05:34

3 Answers3

2

I found the answer in this blog post: http://www.btaz.com/misc/fatal-the-remote-end-hung-up-unexpectedly/ but I'll summarize here in case the link goes down for some reason.

Try doing a git config –list. If your remote.origin.url property looks like this remote.origin.url=git://git.some-domain.com/my-project, the problem is that you have a read-only URL.

Use git config –edit to change the url so something like git@git.some-domain.com:/my-project instead.

This solved my problem.

Jasper
  • 11,590
  • 6
  • 38
  • 55
0

Might be a stupid question, but are you logged in as root or superuser? In this case, git will hang up on you because it hasn't been configured for the root user account (this all assumes that you're running on a Linux or Mac box, not sure how it would work for Windows). Barring that, if you can SSH into the git remote computer, check the permissions on the files and folders in there to see if there's something inconsistent in there.

mluzitano
  • 1
  • 1
  • 1
    I was logged as my normal user and didn't work. Then I have just tried as root and it has worked! I don't understand... – Alicia R. Aug 17 '12 at 08:09
0

This is an access rights issue.

The user you are using to do the push has not enough rights to create /mnt/server.Annax/git/voipsrv_anxsvn/.git/refs/heads/new_branch.lock.

If you did that successful in the past, either you used a different user or the access rights on your origin were changed since then.

eckes
  • 64,417
  • 29
  • 168
  • 201