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://[email protected]/Documents/repos/test 

But I get the following error:

Cloning into 'test'... [email protected]'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?

3
  • You should create bare repository. Or clone ../test/.git Commented Feb 1, 2015 at 10:01
  • 1
    @AlexeyTen no you can clone a non-bare repo as well. I only wonder if /Documents/repos/test is the right path or if it wasn't instead /home/rahil-p001/Documents/repos/test Commented Feb 1, 2015 at 10:02
  • @VonC I'll try that and will let you know. would make sense. Commented Feb 1, 2015 at 10:15

1 Answer 1

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://[email protected]/home/rahil-p/Documents/repos/test 
Sign up to request clarification or add additional context in comments.

3 Comments

@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 (stackoverflow.com/a/28257982/6309).
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 ?
@arashmoeen yes, knowing that, with a bare repo, you don't see any file in it: see more at stackoverflow.com/a/26687327/6309.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.