Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

fatal: does not appear to be a git repository

Tags:

git

git-remote

Why am I getting this error when my Git repository URL is correct?

fatal: '[email protected]/gittest.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly 

See it in context below, or as a screenshot.

jitendra@JITENDRA-PC /c/mySite (master) $ git push beanstalk master fatal: '[email protected]/gittest.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly  jitendra@JITENDRA-PC /c/mySite (master) $ git clone git://github.com/jquery/jquery.git Cloning into jquery... Remote: Counting objects: 19803, done. Remote: Compressing objects: 100% (5196/5196), done. Remote: Total 19803 (delta 14204), reused 19549 (delta 14052) Receiving objects: 100% (19803/19803), 12.80 MiB | 591 KiB/s, done. Resolving deltas: 100% (14204/14204), done.  jitendra@JITENDRA-PC /c/mySite (master) $ gitk --all  jitendra@JITENDRA-PC /c/mySite (master) $ gitk -all  jitendra@JITENDRA-PC /c/mySite (master) $ git remote add origin [email protected]/gittest.git  jitendra@JITENDRA-PC /c/mySite (master) $ git push origin master fatal: '[email protected]/gittest.git' does not appear to be a git repository fatal: The remote end hung up unexpectedly  jitendra@JITENDRA-PC /c/mySite (master) 
like image 965
Jitendra Vyas Avatar asked Sep 06 '11 11:09

Jitendra Vyas


People also ask

How do you solve fatal origin does not appear to be a git repository?

Note: 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 exact location of the remote repository. To solve this error, use the git remote add command to add a remote to your project.

How do I fix fatal not a git repository or any of the parent directories?

For the second situation, you need to initialize the Git repository in your project folder. To do so, you need to navigate to the correct folder and then run the command git init , which will create a new empty Git repository or reinitialize an existing one.

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.


1 Answers

You've got the syntax for the scp-style way of specifying a repository slightly wrong - it has to be:

[user@]host.xz:path/to/repo.git/ 

... as you can see in the git clone documentation. You should use instead the URL:

[email protected]:/gittest.git 

i.e. in the URL you're using, you missed out the : (colon)

To update the URL for origin you could do:

git remote set-url origin [email protected]:/gittest.git 
like image 196
Mark Longair Avatar answered Oct 12 '22 22:10

Mark Longair