Git——git clone私有仓库

git clone 私有项目

在clone的时候,在https://后面先加上github-username:github-token,再@项目的链接即可把项目clone下来。

  • GitHub:加的是token;(Token设置:设置Token
  • Gitee:加的是password;
git clone https://github-username:github-password@github.com/username/project.git
  • example:kyrle是我的用户名
git clone https://kyrle:abcdefg@gitee.com/kyrle/somethingyoulike.git

设置密码不用反复输入

http
git remote set-url origin https://<your_token>@github.com/<USERNAME>/<REPO>.git
ssh
# ssh不需要设置密钥,通过ssh key即可
git remote set-url origin git@github.com:<USERNAME>/<REPO>.git
# eg: git remote set-url origin git@github.com:myname/my_repo.git

如果ssh无反应则尝试:ssh -Tv git@github.com,可以打印log。

参考文章:

  • 6
    点赞
  • 10
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值