0


git - - - 克隆仓库时输入指定账号和密码

  1. 使用 HTTPS 进行克隆

如果克隆的远程仓库使用 HTTPS 协议,那么在克隆的过程中需要输入账号密码。

在命令行中执行git clone命令时,会提示输入账号和密码,可以按照如下格式直接输入:

git clone https://username:password@remote_repository_url

例如:

git clone https://zichenlbl:[email protected]/zichenlbl/gitignore.git

其中,username 是你的账号,password 是你的密码,remote_repository_url 是去掉

https://

后远程仓库的 URL。

这种方式不仅适用于克隆操作,也适用于其他需要验证身份的操作,比如 push、pull 等。

标签: git

本文转载自: https://blog.csdn.net/weixin_48430685/article/details/137105616
版权归原作者 zicl 所有, 如有侵权,请联系我们删除。

“git - - - 克隆仓库时输入指定账号和密码”的评论:

还没有评论