1. 使用 HTTPS 进行克隆 如果克隆的远程仓库使用 HTTPS 协议,那么在克隆的过程中需要输入账号密码。 在命令行中执行git clone命令时,会提示输入账号和密码,可以按照如下格式直接输入: 登录后复制 git clone https://username:password@remote_repository_url 1. 例如: 登录后复制 git clone https://zichenlbl:password@github.com/zichenlbl/gitignore.git 1. 其中,username 是你的账号,password 是你的密码,remote_repository_url 是去掉 https:// 后远程仓库的 URL。 这种方式不仅适用于克隆操作,也适用于其他需要验证身份的操作,比如 push、pull 等。 原创作者: zicl 转载于: https://blog.51cto.com/zicl/11734836