0

When I push my local repository to remote server, I met with "fatal: does not appear to be a git repository" error. So I searched the Internet, and found two possible solution:

Solution 1: fatal: does not appear to be a git repository

Solution 2: git 'origin' does not appear to be a git repository

Solution 1 basically give some idea on how to write the URL correctly when using SSH protocol from your local repository while Solution 2 talks about the remote repository server.

I have used either of the solution. If I use the following git command to add a remote repository I will not have any problems:

git remote add Name ssh://XX@git2.company.com/export/git/Name 

However, if I use the following command to add a remote repository (git remote rm Name first):

git remote add Name ssh://XX@git2.company.com/export/git/Name.git 

I will have errors "fatal: Name.git does not appear to be a git repository" when the local repository is pushed to the remote server. Any ideas? Thanks.

Community
  • 1
  • 1
feelfree
  • 11,175
  • 20
  • 96
  • 167
  • Why you’re using `ssh://`? Git uses SSH by default, there’s no need for that. However, first of all, there must be a colon between the hostname and the path. Try `git remote add UserName XX@git2.company.com:/export/git/UserName.git`. Btw, do you know that the name after `add` is not a username, but just arbitrary name of the remote repo? – Jakub Jirutka Jan 31 '14 at 12:25
  • @JakubJirutka Thanks, I have tried already, but failed. – feelfree Jan 31 '14 at 13:21

1 Answers1

1

Whether or not you need the ".git" extension largely depends on the application used to host your Git repositories. Some of them allow the extension, some don't.

Greg Burghardt
  • 17,900
  • 9
  • 49
  • 92