Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git - error: RPC failed; result=22, HTTP code = 401 fatal: The remote end hung up unexpectedly

Tags:

git

git-remote

I am using ubuntu 11.10 machine. I have installed git of version 1.7.7.1. I am using git-cola to push and pull my code and I was able to commit and push my changes successfully.

Now, I have changed my machine and my new system is with the same above configurations. (Ubuntu 11.10 machine and git version 1.7.7.1).

In the new machine, I have issues on git push. I got the following error message when I tried to push my code:

error: RPC failed; result=22, HTTP code = 401
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly

On internet, I found it may due to any one of the following reason:

  • Wrong git user password (In my case, I fee that I am using the correct password to push the code. Because, even now I was successful, when I push workspace code from my old system (with the same password!). But the problem is only from my new system.
  • To increase buffer size using the following command:

    git config --system http.postBuffer 52428800

I tried this, but no luck. Even tried to increase my buffer size more than 52428800, but still same error.

Stucked on this issue. Can anyone please suggest me a solution.

Thank you.


2 Answers

You must have made a mistake in the remote URL, double-check the output with git remote -v and fix it with

 git remote set-url origin <new-url>

assuming the remote name is origin

like image 81
CharlesB Avatar answered Sep 12 '25 09:09

CharlesB


For people who using TFS git repositories while on Windows. My Windows password recently changed therefor i had

error RPC failed; result=22, HTTP code = 401 fatal: The remote end hung up unexpectedly

when doing diffrent things like fetch, push or pull. We using TFS git repo. I fixed this problem deleting my tfs password from Windows Credential Manager through Control Panel. https://support.microsoft.com/help/4026814/windows-accessing-credential-manager .

like image 40
shemanov Avatar answered Sep 12 '25 08:09

shemanov