java - git-push 命令失败

标签 java git maven github

我已经面临这个问题很长时间了。我能够 ssh 克隆存储库并提交到相同的存储库,但是当尝试 mvn clean release:clean release:prepare release:perform 时构建失败,如下所示。

[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="2d585e485f434c40486d4a445945584f035e4240486e42405d4c4354034e4240" rel="noreferrer noopener nofollow">[email protected]</a>: Permission denied (publickey).
[ERROR] fatal: Could not read from remote repository.
[ERROR] 
[ERROR] Please make sure you have the correct access rights
[ERROR] and the repository exists.

事情是当我尝试 mvn clean release:clean release:prepare release:perform它应该使用 <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="385f514c785f514c504d5a164b57555d7b575548595641165b5755" rel="noreferrer noopener nofollow">[email protected]</a>而不是<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="88fdfbedfae6e9e5edc8efe1fce0fdeaa6fbe7e5edcbe7e5f8e9e6f1a6ebe7e5" rel="noreferrer noopener nofollow">[email protected]</a> 。有人可以帮我解决这个问题吗?

最佳答案

要测试的一种解决方法是:

git config --global <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="b8cdcad496dfd1ccf8dfd1ccd0cdda96dbd7d5" rel="noreferrer noopener nofollow">[email protected]</a>:.insteadOf <a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="97e2e4f2e5f9f6faf2d7f0fee3ffe2f5b9f4f8fa" rel="noreferrer noopener nofollow">[email protected]</a>:

(假设 SSH URL 中使用 :)

这样,Git 将被迫在其 SSH URL 中使用正确的用户。

关于java - git-push 命令失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70937351/

相关文章:

java - 如何通过 SWIG 处理从 C++ 到 Java 的异常

git - 是否可以在另一个分支中将更改推送到主分支

java - Intellij Idea 不会编译 kotlin 但 maven 会

ubuntu - 如何将Java Hotspot Server VM设置为客户端模式?

java - 为什么我收到错误 : "Exception in thread "main"java. lang.NullPointerException”

java - Android:测试改造成功、失败

git 将仓库作为目录移动到另一个仓库

git - 另一个版本控制系统是否具有对文件版本的类似 ClearCase 的文件系统访问权限?

java - 多模块 hibernate 应用程序

java - 无法删除 slf4j 依赖项