Back

Explore Courses Blog Tutorials Interview Questions
+2 votes
2 views
in DevOps and Agile by (29.3k points)

I have a project on which I created a git repository:

$ cd project  

$ git init  

$ git add .  

$ git commit  

I wanted to create a bare clone on another machine:

$ cd ..  

$ git clone --bare project  ssh://[email protected]:/GitRepos/project.git  

I executed the clone but did not print any answer. I logged on to the server machine and tried to see how the files are stored. The path /GitRepos was empty, so I decided to do the clone again:

$ git clone --bare project  ssh://[email protected]:/GitRepos/myproject.git

This time the answer was :

fatal: destination path 'ssh://[email protected]:/GitRepos/project.git' already exists and is not an empty directory.

But I saw that the path was empty.

What's going on here?

closed

1 Answer

+2 votes
by (19.4k points)
selected by
 
Best answer

For repositories on git hub, you could do  try:

git clone ssh://[email protected]/<user>/<repository name>.git

and information about cloning through SSH go through the following:

https://help.github.com/en/articles/connecting-to-github-with-ssh

https://help.github.com/en/articles/which-remote-url-should-i-use#cloning-with-ssh 

Related questions

Browse Categories

...