gpt4 book ai didi

git - 运行 "git clone git@remote.git"时如何提供用户名和密码?

转载 作者:IT王子 更新时间:2023-10-29 01:08:53 28 4
gpt4 key购买 nike

我知道如何为这样的 HTTPS 请求提供用户名和密码:

git clone https://username:password@remote

但我想知道如何像这样向 Remote 提供用户名和密码:

git clone git@remote.git

我试过这样的:

git clone username:password@git@remote.git
git clone git@username:password@remote.git
git clone git@remote.git@username:password

但他们没有奏效。

最佳答案

根据 Michael Scharf 的评论:

您可以省略密码,这样它就不会记录在您的 Bash 历史文件中:

git clone https://username@github.com/username/repository.git

它会提示您输入密码。

或者,您可以使用:

git clone https://username:password@github.com/username/repository.git

这种方式在 GitHub 存储库中对我有用。

关于git - 运行 "git clone git@remote.git"时如何提供用户名和密码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10054318/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com