Git——git clone私有仓库
在clone的时候,在https://后面先加上github-username:github-password,再@项目的链接即可把项目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链接:github 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。
参考文章:
更多推荐
所有评论(0)