Visual Studio 错误推送到远程 git - git-tfs 迁移

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/35019839/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 11:43:50  来源:igfitidea点击:

Visual Studio error pushing to remote git - git-tfs migration

gitvisual-studiotfsgit-tfs

提问by dotnetmensch

I am trying to migrate a TFVC project to Visual Studio Online git repository using git-tfs. Everything works fine for the migration however now whenever I try to sync using Visual Studio 2015 I get this error.

我正在尝试使用git-tfs将 TFVC 项目迁移到 Visual Studio Online git 存储库。迁移一切正常,但是现在每当我尝试使用 Visual Studio 2015 进行同步时,都会出现此错误。

Error encountered while pushing to the remote repository: report-status: protocol error

Even though VS reports this error everything is pushed correctly to the remote repo. If I use the command line or Git Extensions instead of VS I get no error of any kind.

即使 VS 报告了这个错误,一切都被正确地推送到远程仓库。如果我使用命令行或 Git 扩展而不是 VS,则不会出现任何错误。

I also get a lot of strange behavior when trying to create branches. It works fine outside of VS. Using VS to branch doesn't work until I first create a branch outside of VS.

在尝试创建分支时,我也遇到了很多奇怪的行为。它在 VS 之外运行良好。在我第一次在 VS 之外创建一个分支之前,使用 VS 进行分支不起作用。

Has anybody run into this issue?

有没有人遇到过这个问题?

采纳答案by TK-421

You need to make sure you have a branch set as default. Go to the settings of you repo, and click on version control, then right click on your master branch to set as default.

您需要确保将分支设置为默认值。转到你的 repo 的设置,然后单击版本控制,然后右键单击你的主分支以设置为默认值。

enter image description here

在此处输入图片说明

回答by GraehamF

I got this error but with slightly different behavior: changes were NOT pushed to the remote server.

我收到此错误,但行为略有不同:更改未推送到远程服务器。

{Local-Branch} > Right-Click > Pushdid NOT work for me, but the following did:

{Local-Branch} > Right-Click > Push没有对我来说有效,但以下做了:

From the Team Explorer Home screen in Visual Studio 2015:

从 Visual Studio 2015 中的团队资源管理器主屏幕:

  1. Click Branches
  2. Click on the dropdown at the top that has Branches | {ProjectName}
  3. Select Sync
  4. Click Syncbutton.
  1. 点击 Branches
  2. 单击顶部的下拉菜单 Branches | {ProjectName}
  3. 选择 Sync
  4. 单击Sync按钮。

This pushed changes from my local branch to my remote branch.

这将更改从我的本地分支推送到我的远程分支。