Git(五)

怎样简单的clone自己github的私人项目

目前来说,github的私人项目已经可以免费使用了一段时间,但是当你用普通的clone方式去下载到本地的时候,会发现提示clone失败,报错显示

remote: Repository not found.
fatal: repository ‘https://github.com/github-username/github-template-name.git’ not found

正常来说,clone的链接格式一般是

https://github.com/github-username/github-template-name.git

那么当你想要在本地clone自己的私人项目的时候,为了私人项目的安全,就需要加上账号与密码进行验证

git clone https://github-username:github-password@github.com/github-username/github-template-name.git

clone的时候,在https://后面先加上github-username:github-password,再@项目的链接就可以正常的把项目clone下来,这是相对比较简单的clone自己的私人项目的方法。

注意:github上,https方式不能直接clone私有仓库,会提示仓库不存在,ssh方式可以直接clone,那么例如:https://github.com/hxy/changgou.git,https方式clone私有项目需要采用下列方式:

https://hxy:123@github.com/hxy/changgou.git,其中github-username为github用户名:hxy,而不是登录邮箱,123为登录密码;

转载:https://blog.csdn.net/kalenE992/article/details/92029294

 

posted @ 2021-06-02 14:06  迷走神经  阅读(56)  评论(0编辑  收藏  举报