使用密码 Git 克隆 http

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13298198/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-10 14:53:47  来源:igfitidea点击:

Git clone http with password

gitgithub

提问by David542

I am trying to clone a private git repository via http. There is a similar question here: Git clone using http with user and password.

我正在尝试通过 http 克隆一个私有 git 存储库。这里有一个类似的问题:Git clone using http with user and password

Is there a way to do git clone without entering a user/password at the prompt?

有没有办法在不输入用户/密码的情况下进行 git clone 提示?

When I try and do:

当我尝试做:

prodroom15:mquimiro$ git clone https://github.com/user:password/Automator.git
Cloning into 'Automator'...
Username for 'https://github.com': 
Password for 'https://github.com': 

How would I do this so that I don't have to type in the user/password manually?

我将如何做到这一点,以便我不必手动输入用户/密码?

Note that doing the normal https://github.com/user/Automator.gitand manually entering in the user/password at the prompt works fine.

请注意,在提示下执行正常https://github.com/user/Automator.git和手动输入用户/密码工作正常。

回答by Wesley Wiser

I think the syntax is actually https://user:[email protected]not https://github.com/user:password.

我认为语法实际上https://user:[email protected]不是https://github.com/user:password.

If you are using Git 1.7.9 or later, consider using the more secure credential helper mechanism.

如果您使用的是 Git 1.7.9 或更高版本,请考虑使用更安全的凭证辅助机制