简体   繁体   中英

Getting fatal error: .git/info/refs not valid: is this a git repository?

I have a git repo hosted at AWS whom im trying to preform:

git push -u origin master

I am getting the following error:

fatal: http://[URL]/[Repo-Name].git/info/refs not valid: is this a git repository?

Ive tried the answer here without any success: Git .git/info/refs not valid: is this a git repository?

fatal: .git/info/refs not valid: is this a git repository?

What will be the possible solutions over this error?

When I am using

git remote -v

I am getting:

origin  http://[URL]/test1.git (fetch)
origin  http://[URL]/test1.git (push)

The answers you linked refer to a change in the URL. Generally it happens on locally hosted servers such as GitLab that the ports displayed differ. You might want to check what your port is, it may not be the default port(80).

Another reason that causes this error could be missing access rights for the user which tries to connect to the repository. In gitlab, make sure that the user is a member of the repository and is registered as Developer .

Please check if your remote git repository is local or remote and if you are going through a Proxy or not.

For local repo you should bypass the proxy. For example, to bypass proxy for your repo at "origin" you can use this:

git config --add remote.origin proxy "" 

This will bypass proxy, if you are inside a corporate firewall and you should not get this error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM