我想通过添加用户名和密码来克隆git存储库以进行这样的身份验证:
https://myUserName:myPassWord@myGitRepositoryAddress/myAuthentificationName/myRepository.git
但是我的密码包括@
(如123@asd
),这会导致git存储库网址出现问题,并且出现如下错误:
https://123@myGitRepositoryAddress/myAuthentificationName/myRepository.git
并且第一个@
视为分隔符。
为了在URL中使用@
符号,您必须使用percent-encoding。 @
的百分比代码为%40
。因此,如果要使用用户名user
和密码123@asd
克隆存储库,则必须使用以下URL:
https://user:123%40asd@myGitRepositoryAddress/myAuthentificationName/myRepository.git