【发布时间】:2019-10-24 21:59:25
【问题描述】:
我在使用 git 的 shell 脚本时遇到问题,该脚本会询问机器人用户帐户的密码,以便像这样进行克隆/推送:
echo 'write the pass'
read pass
git clone https:\\user:$pass@bitbucket... destination
问题是它向我展示了:
fatal: Authentication failed for 'https:\\user:$pass@bitbucket...'
我尝试了https:\\user:${pass}@bitbucket...,结果相同
如果我直接尝试没有任何变量,例如
git clone https:\\user:password@bitbucket... destination
效果很好。
你知道是什么问题吗?
【问题讨论】:
-
调试这个在克隆命令之前添加
echo "$pass"也总是双引号你的变量。