我正在尝试通过 http 克隆一个私有(private) git 存储库。这里有一个类似的问题:Git clone using http with user and password .
有没有办法在提示时不输入用户/密码就可以执行 git clone?
当我尝试做的时候:
prodroom15:mquimiro$ git clone https://github.com/user:password/Automator.git
Cloning into 'Automator'...
Username for 'https://github.com':
Password for 'https://github.com':
我该怎么做才能不必手动输入用户名/密码?
请注意,执行正常的 https://github.com/user/Automator.git
并在提示时手动输入用户名/密码可以正常工作。
最佳答案
我认为语法实际上是 https://user:password@github.com
而不是 https://github.com/user:password
。
如果您使用的是 Git 1.7.9 或更高版本,请考虑使用更安全的 credential helper mechanism .
关于Git clone http 带密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13298198/