Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

github

I have a Git repository hosted at Assembla for which I'm trying to perform:

git push -u origin master

I'm getting the following error over and over again:

fatal: https://[url]/[repo-name].git/info/refs not valid: is this a git repository?

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

When I use:

git status

I get:

On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
like image 556
Omri Shneor Avatar asked Mar 27 '17 14:03

Omri Shneor


People also ask

How do I fix a fatal not a Git repository?

Check that you correctly created the repo. If the directory doesn't contain a . git repo, use git init to properly initialize the repo or clone an existing repo. Make sure your HEAD file contains the correct information on your current branch.

What does fatal not a Git repository mean?

What does “fatal: not a git repository” mean? This error means you attempted to run a Git command, but weren't inside a Git repository. Make sure you've: Navigated to the right directory.

Why does it say not a Git repository?

The “not a git repository” error is common. The cause is running a Git command in the wrong folder or running a Git command before initializing a Git repository.

What is fatal error in Git bash?

What causes “fatal: not a git repository”? The fatal: not a git repository error makes it clear that you're not in a git repository, but the reason you're not in such a repository may be one of two: 1. You tried to run the command but did not navigate to the project folder where the git repository is located.


2 Answers

I have exactly that error message (I am still ignoring the cause) and I solved it in a different but simple way:

git fetch --all

It is a solution suggested among many others here.

like image 153
Stefano Scarpanti Avatar answered Oct 19 '22 06:10

Stefano Scarpanti


Make sure the proxy is set correctly for Git if you're behind a proxy!

git config --global http.proxy <proxyserver>
like image 26
TheJeff Avatar answered Oct 19 '22 05:10

TheJeff