Перейти к содержимому

Клон GitHub хранилище без аккаунта?

20

Я собираю некоторую документацию и не имею доступа к ненастроенной машине, чтобы проверить это сам

Мне интересно, нужна ли вам учетная запись GitHub для клонирования хранилища из GitHub на локальный компьютер.

26 500 просмотров
Steven M. Vascellaro спросил 13 лет назад
S 4 126

4 ответа

27
Принятый ответ

No. You just use a different URL:

git clone git://github.com/SomeUser/SomeRepo.git 

However, the local repo will be "read-only" in the sense that you won't be able to push your changes back to the original repo. You will still able to modify files and commit changes locally, though.

In contrast,

git clone git@github.com:UserName/OtherRepo.git 

works only if you have properly set up your environment with the necessary SSH keys and whatnot, but in return you'll get a repository that permits you to commit/push the changes back to the remote repo.

(Sorry for the unintentional ad for GitHub, I just had it in mind.)

Круто, спасибо за разъяснения. Я знаю об ограничениях при подходе к клону таким образом, но это хорошо для контекста процесса, который я документирую.

· 13 лет назад · 0

@JosephMainwaring Я рад, что помог. Пожалуйста, не забудьте принять мой ответ, когда вы сможете это сделать.

H2CO3 · 13 лет назад · 0

Для GitLab это git clone https: // gitlab.com / SomeUser / SomeRepo.git

Matthias Braun · 9 лет назад · 0
H2CO3 ответил 13 лет назад
H 904
2

I was following some documentation for a product which required cloning from github. I didn't want to bother setting up an account so I needed to do exactly what was asked here.

The command in the documentation was:

git clone git://github.com/fcrepo4/fcrepo-message-consumer.git 

but that just fails for me with.

Cloning into 'fcrepo-message-consumer'... ssh: Could not resolve hostname github.com: nodename nor servname provided, or not known fatal: Could not read from remote repository. 

I tried

git clone git://github.com/fcrepo4/fcrepo-message-consumer.git 

as suggested in one of the answers but that failed too with.

Cloning into 'fcrepo-message-consumer'... fatal: Unable to look up github.com (port 9418) (nodename nor servname provided, or not known) 

What finally worked was this:

git clone https://github.com/fcrepo4/fcrepo-message-consumer.git 
Dale ответил 11 лет назад
D 121
0

Или просто используйте префикс http, и суффикс .git тоже не обязателен:

Вы можете проверить с

git clone http://github.com/tizenteam/iotivity-example 

Информация по теме:

https://help.github.com/articles/why-is-git-always-asking-for-my-password/

Анонимная загрузка на самом деле не будет работать для меня, пока я не уберу суффикс .git.

jhfrontz · 8 лет назад · 0
rzr ответил 9 лет назад
R 202
0

Вы можете использовать Github Tokens https://github.com/settings/tokens и использовать это:

git config --global url."https://$:x-oauth-basic@github.com/".insteadOf "https://github.com/" 

(заменить $на текущий токен

Jann Anthony Briza ответил 7 лет назад
J 1