eclipse中用git提交代码报错
操作流程:
1、自己在服务器上搭了一个gogs做git仓库服务器,按流程配置后能正常访问。
2、在本地eclipse上新建了一个项目
3、根据本地项目生成一个本地的git仓库,并提交项目代码
4、提交本地仓库到刚刚搭建好的服务器git仓库上,报错!
上面2张图片是最后一步提交的截图。
问过一个大神,说是401报错一般是账号密码不对导致的没权限,但是我能保证我输入的是正确的
同时,git服务器仓库本身应该也是没问题的,因为我让同事也测试了一下,然后他是直接再控制台用命令提交的,成功了
在网上查的时候有帖子说是eclipse bug导致的(我问的大神说应该不是,但是他人在其他地方,没看到实际情况,只是根据我的描述):http://blog.csdn.net/yang5726...
附加说明开发环境:
spring-tool-suite-3.9.0.RELEASE-e4.7.0-win32-x86_64(基于最新版eclipse 4.7)
JDK8
补充:
eclipse错误日志
!ENTRY org.eclipse.egit.core 4 0 2017-08-16 16:41:30.183
!MESSAGE An exception occurred during push on URI http://10.0.10.49:3000/gogs/test-gogs.git: http://10.0.10.49:3000/gogs/test-gogs.git: 401 Unauthorized
!STACK 0
org.eclipse.jgit.errors.TransportException: http://10.0.10.49:3000/gogs/test-gogs.git: 401 Unauthorized
at org.eclipse.jgit.transport.TransportHttp$Service.openResponse(TransportHttp.java:972)
at org.eclipse.jgit.transport.TransportHttp$MultiRequestService.execute(TransportHttp.java:1076)
at org.eclipse.jgit.transport.TransportHttp$Service$HttpExecuteStream.read(TransportHttp.java:1001)
at org.eclipse.jgit.util.io.UnionInputStream.read(UnionInputStream.java:145)
at java.io.FilterInputStream.read(Unknown Source)
at org.eclipse.jgit.util.io.TimeoutInputStream.read(TimeoutInputStream.java:112)
at org.eclipse.jgit.util.IO.readFully(IO.java:247)
at org.eclipse.jgit.transport.PacketLineIn.readLength(PacketLineIn.java:225)
at org.eclipse.jgit.transport.SideBandInputStream.needDataPacket(SideBandInputStream.java:154)
at org.eclipse.jgit.transport.SideBandInputStream.read(SideBandInputStream.java:136)
at org.eclipse.jgit.util.IO.readFully(IO.java:247)
at org.eclipse.jgit.transport.PacketLineIn.readLength(PacketLineIn.java:225)
at org.eclipse.jgit.transport.PacketLineIn.readString(PacketLineIn.java:155)
at org.eclipse.jgit.transport.BasePackPushConnection.readStringLongTimeout(BasePackPushConnection.java:437)
at org.eclipse.jgit.transport.BasePackPushConnection.readStatusReport(BasePackPushConnection.java:369)
at org.eclipse.jgit.transport.BasePackPushConnection.doPush(BasePackPushConnection.java:221)
at org.eclipse.jgit.transport.TransportHttp$SmartHttpPushConnection.doPush(TransportHttp.java:886)
at org.eclipse.jgit.transport.BasePackPushConnection.push(BasePackPushConnection.java:170)
at org.eclipse.jgit.transport.PushProcess.execute(PushProcess.java:172)
at org.eclipse.jgit.transport.Transport.push(Transport.java:1310)
at org.eclipse.egit.core.op.PushOperation.run(PushOperation.java:189)
at org.eclipse.egit.ui.internal.push.PushJob.performJob(PushJob.java:84)
at org.eclipse.egit.ui.internal.jobs.RepositoryJob.run(RepositoryJob.java:57)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:56)
!ENTRY org.eclipse.egit.ui 4 0 2017-08-16 16:41:30.187
!MESSAGE Can't connect to any repository: http://10.0.10.49:3000/gogs/test-gogs.git (http://10.0.10.49:3000/gogs/test-gogs.git: 401 Unauthorized)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不建议用eclispe的Egit(我记得N年没更新了的吧?)插件, 第三方客户端推荐github for windows 或 atom 自带的, 或者TortoiseGit
当然用idea的话就没这问题了, 感觉idea的比其它的都好用。