1

On the remote machine (ubuntu 12.04 ) I created a test/ folder in my repo folder and inside the folder I used:

git init

Running command ll inside the test folder will show me that there's .git folder inside test.
Now I want to clone remotely from this machine on my own machine (ubuntu 12.04) using:

git clone ssh://rahil-p001@172.16.35.117/Documents/repos/test

But I get the following error:

Cloning into 'test'...
rahil-p001@172.16.35.117's password: //I enter password then...
fatal: '/Documents/repos/test' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

I'm quite new to using git and can't think of any reason that it shouldn't work.
How would you explain that error message?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
arash moeen
  • 4,533
  • 9
  • 40
  • 85

1 Answers1

1

That would be explained by the fact a normal Ubuntu distribution does not have a /Documents

http://1.bp.blogspot.com/-vuqCDlnP_Rc/TfLv5Ql6YmI/AAAAAAAAAKE/g8oVglafrVY/s640/directory.jpg

(See for instance "The directory Tree")

Try instead the full path (check it with pwd -P) of your non-bare repo:

git clone ssh://rahil-p001@172.16.35.117/home/rahil-p/Documents/repos/test
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    @arashmoeen Great. Don't forget that by default, you cannot push back to that (non-bare) repo. At least not until Git 2.3.0 and its new `git config receive.denyCurrentBranch=updateInstead` (http://stackoverflow.com/a/28257982/6309). – VonC Feb 01 '15 at 10:19
  • Aha so if I wanna push back my changes from my own local machine to the remote repo I should've made it bare using **git init --bare** ? – arash moeen Feb 01 '15 at 10:24
  • @arashmoeen yes, knowing that, with a bare repo, you don't see any file in it: see more at http://stackoverflow.com/a/26687327/6309. – VonC Feb 01 '15 at 10:26