我正在尝试通过http克隆私有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
并在提示符下手动输入用户/密码正常。
答案 0 :(得分:21)
我认为语法实际上是https://user:password@github.com
而不是https://github.com/user:password
。
如果您使用的是Git 1.7.9或更高版本,请考虑使用更安全的credential helper mechanism。