比如我的账号和密码分别是
如果按照如下写法就会报错
[remote "origin"]
url = "https://username:123@456@demo.github.com/username/project.git"
fetch = +refs/heads/*:refs/remotes/origin/*
正确的写法是将特殊字符编码
比如 @
字符需要编码为%40
正确的写法
[remote "origin"]
url = "https://username:123%40456@demo.github.com/username/project.git"
fetch = +refs/heads/*:refs/remotes/origin/*
特殊字符对应表
空格 - %20
" - %22
# - %23
% - %25
& - %26
( - %28
) - %29
+ - %2B
, - %2C
/ - %2F
: - %3A
; - %3B
< - %3C
= - %3D
> - %3E
? - %3F
@ - %40
\ - %5C
| - %7C
参考