Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I am trying to clone my entire github repo onto a new machine. On the website, the url looks something like this:

https://github.com/MyName

However, when I do this:

git clone https://github.com/MyName C:/Users/MyName/Documents/GitHub/

I get

>Cloning into GitHub 'C:/Users/MyName/Documents/GitHub/'
>fatal: repository 'https://github.com/MyName' not found
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
137 views
Welcome To Ask or Share your Answers For Others

1 Answer

https://github.com/MyName would be the URL for an account, not a repo. For instance, jQuery (the company) has an account at https://github.com/jquery. If I try to clone from that URL, I get a clone error:

git clone https://github.com/jquery
>>> Cloning into 'jquery'...
>>> fatal: repository 'https://github.com/jquery' not found

Which makes sense - that URL isn't of a repository.

Meanwhile, if I actually clone the project, https://github.com/jquery/jquery, it works:

git clone https://github.com/jquery/jquery.git
>>> Cloning into 'jquery'...
>>> remote: Counting objects: 36035, done.
>>> remote: Compressing objects: 100% (91/91), done.
>>> remote: Total 36035 (delta 60), reused 0 (delta 0), pack-reused 35944
>>> Receiving objects: 100% (36035/36035), 21.72 MiB | 2.77 MiB/s, done.
>>> Resolving deltas: 100% (25434/25434), done.
>>> Checking connectivity... done.

If you want to clone all the repos under a username, there isn't a native way to do that. However, clone-all or github-clone seem to fit the bill as tools that'll do this for you.

The general procedure that you would need to do (by hand or with a tool) would be:

  1. Get a list of URLS containing all repos for an org/user.
  2. Clone each of theme using git clone.

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...