我知道如何为HTTPS请求提供用户名和密码,如下所示:
git clone https://username:password@remote
Run Code Online (Sandbox Code Playgroud)
但我想知道如何为遥控器提供用户名和密码,如下所示:
git clone git@remote.git
Run Code Online (Sandbox Code Playgroud)
我试过这样的:
git clone username:password@git@remote.git
git clone git@username:password@remote.git
git clone git@remote.git@username:password
Run Code Online (Sandbox Code Playgroud)
但他们没有奏效.
我有git代理配置为'http.proxy = http:// userId:pwd @ 123 @ipaddress:port'但是在克隆远程项目时,我收到错误
Cloning into git...
error: Couldn't resolve proxy '123@ipaddress' while accessing http://git.kernel.org/pub/scm/git/git.git/info/refs
fatal: HTTP request failed
Run Code Online (Sandbox Code Playgroud)
如何逃避密码中的'@'字符?
请注意:我无法更改密码.
我想克隆一个使用ssh的存储库.为此,我需要输入我的用户名.我试图在运行"git clone git@remote.git"时如何提供用户名和密码?.但是,我的用户名中包含@,这似乎与命令混乱.
我当前没有输入用户名的命令是sudo git clone ssh://git@git.x/y/.现在我想做同样的事,但用我的用户名abc@gmail.com.我怎么做?
如果我试着写,sudo git clone abc@gmail.com@git.x/y/我得到错误repository abc@gmail.com@git.x/y/ does not exist