2

I set up a git repository in a directory named ABC3 on my remote server public_html/ABC3.

git init

I want to clone the repository to my local computer. Here's what I do: cd into the directory where I want to work, say Desktop/GitFun, then I attempt to clone with the following command

git clone myusername@myserver.com:/public_html/ABC3.git

After entering my password I get back the error

fatal: '/public_html/ABC3.git' does not appear to be a git repository
fatal: Could not read from remote repository.

Am I doing it right? ABC3 is the name of the directory, right?

Probably important: I'm working with a Bluehost shared server. On their site they mention installing GIT on a VPS or private server, but nothing about it on the shared server. When I git --version I get a positive response, 1.7.11.3. Suggestions?

icicleking
  • 1,029
  • 14
  • 38

2 Answers2

1

Considering you have created a non-bare repo, the url should have been:

git clone myusername@myserver.com:/public_html/ABC3

I would recommend creating a bare repo though (as in this video):

cd /public_html
git init --bare ABC3

Then the url would be indeed:

git clone myusername@myserver.com:/public_html/ABC3.git
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

This answer could be useful for others whose git repository is not in public_html

If you created your bare repo here:

cd ~
mkdirs git/myapp.git
cd git/myapp.git
git init --bare

You can try (note the use of ~ instead of /home/myusername)

git clone myusername@myserver.com:~/git/myapp.git

If this still does not work, I also incorporated suggestions from here and here

Mikaël Mayer
  • 10,425
  • 6
  • 64
  • 101