Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git "does not appear to be a git repository"

Tags:

I am trying to install git on a server and have some problem when I try to perform the first push. I successfully installed git on the server, created the repository locally and on the server but when I try to make the first push I get this message:

stdin: is not a tty fatal: '/my_repo.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly 

I googled it and followed everything I could find but nothing worked. What could be wrong?

like image 363
romainberger Avatar asked Apr 30 '12 22:04

romainberger


People also ask

How do you fix does not appear to be a git repository?

The “fatal: 'origin' does not appear to be a git repository” error occurs when you try to push code to a remote Git repository without telling Git the location of the remote repository. To solve this error, use the git remote add command to add a remote to your project.

Does not appear to be a git repository but it is?

The “… does not a appear to be a git repository” error is triggered when you try to clone, or run other commands, in a directory that is not recognized as a Git repository. The directory or remote file path might not have initialized Git, or the file path you are trying to access as an active repository is incorrect.

Does not appear to be a git repository please make sure you have the correct access rights?

The “Please make sure you have the correct access rights” error occurs if you do not have the right permissions to access a Git repository. To solve this error, make sure you are referring to the correct remote URL and that you have set up SSH authentication correctly.


2 Answers

I will assume you are using ssh to clone your repo.

That means you need the full path of the repo on the server in your ssh address:

git clone ssh://sshuser@serverIP/full/absolute/path/to/my_repo 

Note: if your 'my_repo' is a bare one (to allow pushing), that would be:

git clone ssh://sshuser@serverIP/full/absolute/path/to/my_repo.git 

The stdin: is not a tty simply means that in the .bashrc of the sshuser account, there is something expecting an input.

like image 106
VonC Avatar answered Oct 06 '22 11:10

VonC


May be you forgot to run git --bare init on the remote folder That was my problem

like image 44
user3353537 Avatar answered Oct 06 '22 09:10

user3353537