我正在尝试推送我的项目(所有文件都在新的存储库中).我按照步骤操作,但当我推进时,git push -u origin master我收到此错误:
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@github.com:asantoya/projectnewbies.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.
Run Code Online (Sandbox Code Playgroud)
很多次我得到这个错误,无法弄清楚该怎么做.
我几个月来一直在使用Gitlab而没有问题.但是,从昨天开始,我不能再从Eclipse IDE"到达"(获取,推送,...)Gitlab.
无论我是在我的公司工作(可能是代理问题)还是在家里工作.
我收到以下错误消息:
https://gitlab.com/XXX/XXX.git:
cannot open git-upload-pack
cannot open git-upload-pack
Run Code Online (Sandbox Code Playgroud)
看看我的Eclipse .log,原因是:
Caused by: javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
at org.eclipse.jgit.transport.http.JDKHttpConnection.getResponseCode(JDKHttpConnection.java:98)
at org.eclipse.jgit.util.HttpSupport.response(HttpSupport.java:168)
at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:460)
... 10 more
Run Code Online (Sandbox Code Playgroud)
添加http.sslVerify=false我的Eclipse/Git配置没有帮助...
知道为什么会(突然)发生这种情况吗?
所以让我设置我的场景。我在 Spring Tool Suite (Eclipse 4.5.1) 中使用 EGit 4.1.1。我和我精通技术的同事从远程 URL 克隆了相同的 git 存储库。我精通技术的同事更喜欢命令行,他使用 VIM 修改文件,然后发出命令
git add .
git commit -m "Modified file"
git push
Run Code Online (Sandbox Code Playgroud)
现在更改位于远程存储库中。现在,我不太喜欢 CLI,更喜欢 GUI,我在 Eclipse 中使用 EGit。要接收更改,我右键单击该项目(我最初是使用 EGit 克隆的),转到 Team -> Pull,然后我被告知有“ Nothing to fetch ”。出于理智的考虑,我打开了“Git Reflog”视图,我看到我同事的更改没有列出,我开始挠头。
所以我转到命令行并发出命令git pull,瞧!,它拉入了我的同事更改:
remote: Counting objects: 27, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 14 (delta 4), reused 0 (delta 0)
Unpacking objects: 100% (14/14), done.
From git://hostname.domain.com/git-repo
* branch master -> FETCH_HEAD
Updating 123ae12..68cd2f0
Fast-forward …Run Code Online (Sandbox Code Playgroud)