1

I have the following remote directory:

/home/darren77

I use git init --bare to set up the directory as a repo

which adds .git directory

Then on local pc I have directory that is my workspace

c:/testAccount/

I then try to clone the remote repo to set up to push:

$ git clone ssh://darren77@tinbad.com/home/darren77.git

But I get the following:

stdin: is not a tty
fatal: '/home/darren77.git' does not appear to be a git repository
fatal: Could not read from the remote repository

Please make sure you have the correct access rights and the repository exists.

What am I doing wrong? There's so much talk about this but no one place that actually details it in absolute basic format for users new to git, not that I can find anyway.

StudioTime
  • 22,603
  • 38
  • 120
  • 207

2 Answers2

1

Try:

git clone ssh://darren77@tinbad.com/home/darren77/.git

The git init --bare could have created a .git folder inside /home/darren77

A more appropriate name for that repo would be:

cd /home/darren77
git init --bare myrepo

That will create a myrepo.git/ folder (a folder ending with .git)

Then you would clone it with:

git clone ssh://darren77@tinbad.com/home/darren77/myrepo.git
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • that is correct, it has! Although everywhere else I;ve searched has the same dir structure and they say remove trailing slash – StudioTime Jun 09 '14 at 07:48
  • @DarrenSweeney I have updated the answer to show you a more appropriate name for your bare repo. – VonC Jun 09 '14 at 07:49
0

You should probably not make a home directory a repository. Make a subdirectory called repos or something and then a bare repository inside that with the name of your project and a .git suffix. The path would be /home/darren77/repos/project0.git. Inside this directory would be the contents of the .git directory (i.e. a bare repository).

git init --bare shouldn't create a .git directory. If it is, something is wrong.

After verifying these, try ssh darren77@tinbad.com to see if you can connect to the server properly. If yes, consider using this syntax (it's what I use). git clone darren77@tinbda.com:/home/darren77/repos/project0.git

Noufal Ibrahim
  • 71,383
  • 13
  • 135
  • 169