简体   繁体   English

Git push在Visual Studio 2015中不起作用

[英]Git push not working in visual studio 2015

My visual studio 2015 works fine with Git connecting to BitBucket. 我的Visual Studio 2015在Git连接到BitBucket时可以很好地工作。 However when connecting to a private Gitlab server, I have a weird problem: - I can clone a repo from the gitlab server via the IDE (Team explorer). 但是,当连接到私有Gitlab服务器时,我遇到一个奇怪的问题:-我可以通过IDE(团队浏览器)从gitlab服务器克隆一个仓库。 I can fetch/pull, put whenever I try to sync a local commit to the server, I get an error (error encountered while pushing to the remote repository... 500...). 我可以获取/拉取,每当尝试将本地提交同步到服务器时,都会收到错误消息(推送到远程存储库时遇到错误... 500 ...)。 Obviously the gitlab server returns a 500 internal server error. 显然gitlab服务器返回500内部服务器错误。 However when I open a command line from within team explorer and issue a 'git push', there are no errors and the push succeeds. 但是,当我从团队资源管理器中打开命令行并发出“ git push”命令时,没有错误,并且推送成功。

  • Is there a difference between the team explorer push and the command line push? 团队资源管理器推送和命令行推送之间有区别吗?

  • Is there a way to see what request team explorer sends to the gitlab server while pushing? 有没有办法查看团队资源管理器在推送时发送到gitlab服务器的请求?

On further inspection I found a difference between the GIT command line client and the builtin cliënt in visual studio. 在进一步检查中,我发现GIT命令行客户端和Visual Studio中的内置客户端之间存在差异。 The latter uses TLS1.2 for the https session, whereas the command line uses TLS 1.0. 后者将TLS1.2用于https会话,而命令行使用TLS 1.0。

As it happens out private GITLAB server is situated behind a reverse proxy that has problems with TLS1.2 connections resulting in the weird behaviour (fetch & pull OK, no push). 发生这种情况时,私有GITLAB服务器位于反向代理后面,该反向代理存在TLS1.2连接问题,从而导致奇怪的行为(获取并拉动OK,不推入)。

It seems like you've diagnosed the problem yourself (nice sleuthing!) But to answer your two direct questions: 看来您已经自己诊断了问题(很好侦探!),但要回答两个直接问题:

There is a difference between the tooling built in to Visual Studio and the command line. Visual Studio内置的工具和命令行之间有区别。 Visual Studio uses libgit2 , which is a reimplementation of git as a linkable library. Visual Studio使用libgit2 ,它是git作为可链接库的重新实现。 It does not shell out to the command line at all to perform its work. 它根本不使用命令行执行任务。

As a result, no, you cannot see the commands, as it is not actually running any. 结果,没有,您看不到命令​​,因为它实际上没有运行任何命令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM