0

I have two folders sitting next to each other on my machine.

  • /Documents/Learning/Project1
  • /Documents/Learning/Test for git

Project1 has a local repository inside with one commit on it, and I'd like to copy it to the other folder. I'm running the commands:

/Documents/Learning/Test for git$ git clone /Documents/Learning/Project1 .
fatal: repository '/Documents/Learning/Project1' does not exist

/Documents/Learning/Test for git$ git clone /Documents/Learning/Project1.git .
fatal: repository '/Documents/Learning/Project1' does not exist

/Documents/Learning/Test for git$ git clone /Documents/Learning/Project1.git .
fatal: repository '/Documents/Learning/Project1' does not exist

/Documents/Learning/Test for git$ git clone /Documents/Learning/Project1/.git .
fatal: repository '/Documents/Learning/Project1' does not exist

/Documents/Learning/Test for git$ git clone /Documents/Learning/Project1 .
fatal: repository '/Documents/Learning/Project1' does not exist

/Documents/Learning/Test for git$ git clone /Documents/Learning/Project1 .
fatal: repository '/Documents/Learning/Project1' does not exist

/Documents/Learning/Test for git$ git clone /Documents/Learning/Project1.git .
fatal: repository '/Documents/Learning/Project1' does not exist

/Documents/Learning/Test for git$ git clone /Documents/Learning/Project1/git .
fatal: repository '/Documents/Learning/Project1' does not exist

/Documents/Learning/Test for git$ git clone /Documents/Learning/Project1/.git .
fatal: repository '/Documents/Learning/Project1' does not exist

But I keep getting an error saying repository doesn't exist, what am I missing?

0

1 Answer 1

1

Your repository is not in /Documents/Learning/Project1. It's in /home/<your username>/Documents/Learning/Project1. You could also use the shortcut ~/Documents/Learning/Project1.

Note that you can't git clone into an existing (non-empty) directory, so you should delete ~/Documents/Learning/Test for git and your command should be (assuming your current working directory is ~/Documents/Learning/):

$ git clone ~/Documents/Learning/Project1/ ./Test\ for\ git/
2
  • Thanks, worked like a charm. As for cloning into a existing repository I just used /Documents/Learning/Test for git$ git clone /home/kyle/Documents/Learning/Project1/.git . apparently the . at the end lets you copy it to the directory your currently in. Sep 1, 2019 at 20:21
  • My bad. You can git clone into an existing empty directory. Sep 1, 2019 at 20:30

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .