Git克隆私人github存储库

时间:2020-06-04 12:46:30

标签: git github

我想将私有github存储库克隆到另一台设备。在另一个问题中,答案是添加用户名和密码,如下所示:

git clone 'https://username:password/github.com/username/repo/'

但是,对我来说,该结果集出现以下错误:

fatal. unable to access 'https://name:password/github.com/username/repo/': URL using bad/illegal format or missing URL

我在做什么错?我希望大家能帮助我。谢谢!

编辑: 我将问题标记为重复,建议的问题解决了我的问题。

1 个答案:

答案 0 :(得分:0)

尝试使用git@github.com而不是https://

如果仍然无法正常工作,请遵循以下

以下步骤应该有效

  1. 在git hub中创建访问令牌
  2. git clone https://github.com/username/repo_name.git
  3. 输入您的用户名并使用访问令牌作为密码