Search code examples
githttporaclelinux

Error executing git command on Oracle Linux server, returns error code 501


I am trying to execute the following git command on my server (Oracle Linux 6):

git ls-remote -h https://<my-repo-path>.git

But it throws the following error:

error: The requested URL returned error: 501 Method Not Implemented while accessing https://<my-repo-path>.git/info/refs

Git version is 1.7.1 and I am unable to update it to any latest version (unless I built it from source which I am reluctant to do at this point). Can someone help please?


Solution

  • The error is not necessarily a Git one, but one from the remote HTTP server, which return a custom error message (not seen in Git itself): looking at the logs of that server might yield more clues.

    In the meantime, if possible, you could try using an SSH URL, provided you can make your public SSH key registered on the server side, on the account managing those Git repos.

    Then this would work: git ls-remote <remoteAccount>@<server>:/path/to/git/repo

    Or: if the repo is on the same server as the one you are executing your command, you can use its path directly:

    git ls-remote -h /path/to/git/repo
    

    But upgrading first remain a good option, which the OP saikat confirms in the comments:

    Issue solved after upgrading the git version