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
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? 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.
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 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.
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.
Make sure the proxy is set correctly for Git if you're behind a proxy!
git config --global http.proxy <proxyserver>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With