我有一个密码!在它和我尝试使用以下语法从git克隆存储库时:
git clone https://username:password!@github.com/org/repository.git
我收到此错误:
bash: !@github.com/org/repository.git: event not found
如何在不更改密码的情况下修复它?
我在Linux。我在Windows中使用过这个没有任何问题。
答案 0 :(得分:8)
只是反斜杠感叹号。它在bash(历史扩展)中具有特殊意义。
git clone https://username:password\!@github.com/org/repository.git
您也可以将其包装成单引号('
):
git clone 'https://username:password!@github.com/org/repository.git'