Search code examples
gitgit-remote

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


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.


Solution

  • 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