项目场景:
项目仓库地址原来是ip地址,后因不在公司办公,需将Ip地址换成域名。
更换流程
修改remotes中的URL报错。
fatal: could not read Username for 'https://gitlab.xxxxzh.com': Device not configured
问题描述
尝试使用域名仓库地址新建项目报:
Invocation failed Server returned invalid Response.
java.lang.RuntimeException: Invocation failed Server returned invalid Response.
at git4idea.GitAppUtil.sendXmlRequest(GitAppUtil.java:22)
at git4idea.http.GitAskPassApp.main(GitAskPassApp.java:56)
Caused by: java.io.IOException: Server returned invalid Response.
at org.apache.xmlrpc.LiteXmlRpcTransport.sendRequest(LiteXmlRpcTransport.java:242)
at org.apache.xmlrpc.LiteXmlRpcTransport.sendXmlRpc(LiteXmlRpcTransport.java:90)
at org.apache.xmlrpc.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:72)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:194)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:185)
at org.apache.xmlrpc.XmlRpcClient.execute(XmlRpcClient.java:178)
at git4idea.GitAppUtil.sendXmlRequest(GitAppUtil.java:19)
... 1 more
error: unable to read askpass response from '/Users/mac/Library/Caches/JetBrains/IntelliJIdea2021.3/tmp/intellij-git-askpass-local.sh'
fatal: could not read Username for 'https://gitlab.xxxxzh.com': Device not configured
原因分析:
尝试解决:
- cd /Users/mac/IdeaProjects/20220317/项目名称/.git
- vi config
- 修改此处URL
无效。
解决方案:
报错中提示找不到账号名和密码,那么就在Git地址中拼接账号密码。
注意用户名中@符号要换成%40
https://lx%40zhanghao:mima@gitlab.xxxxzh.com/stoxxxx/stxxxxvice.git
注意:
如果git仓库中文件名称存在特殊字符,例如\ : 这些,会导致clone不了