- 使用 HTTPS 進行克隆
如果克隆的遠(yuǎn)程倉庫使用 HTTPS 協(xié)議,那么在克隆的過程中需要輸入賬號密碼。
在命令行中執(zhí)行g(shù)it clone命令時,會提示輸入賬號和密碼,可以按照如下格式直接輸入:
git clone https://username:password@remote_repository_url
例如:
git clone https://zichenlbl:password@github.com/zichenlbl/gitignore.git
其中,username 是你的賬號,password 是你的密碼,remote_repository_url 是去掉 https://
后遠(yuǎn)程倉庫的 URL。文章來源:http://www.zghlxwxcb.cn/news/detail-853841.html
這種方式不僅適用于克隆操作,也適用于其他需要驗證身份的操作,比如 push、pull 等。文章來源地址http://www.zghlxwxcb.cn/news/detail-853841.html
到了這里,關(guān)于git - - - 克隆倉庫時輸入指定賬號和密碼的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!