git Visual Studio Online 上的远程分支未出现在 Visual Studio 2015 团队资源管理器中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/32101635/
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
Remote branch on Visual Studio online doesn't appear on Visual Studio 2015 Team Explorer
提问by VansFannel
I have created a new Git repository on Visual Studio online. I have cloned on my computer and I have added it a project. After that, I have created a new branch called develop on Visual Studio online, and I have tried to check it out creating a new local branch but it doesn't appear on Team Explorer.
我在 Visual Studio 在线创建了一个新的 Git 存储库。我已经在我的计算机上进行了克隆,并将其添加到一个项目中。之后,我在 Visual Studio online 上创建了一个名为 develop 的新分支,我尝试检查它是否创建了一个新的本地分支,但它没有出现在 Team Explorer 中。
This is my Visual Studio online:
And this is Visual Studio 2015 Team Explorer:
这是 Visual Studio 2015 团队资源管理器:
Why develop branch doesn't appear on Team Explorer?
为什么开发分支没有出现在团队资源管理器上?
回答by Dr Rob Lang
回答by VansFannel
I have solved my problem opening a Git Command Prompt (following this instructions), and doing a git fetch
to retrieve the new branch.
我已经解决了打开 Git 命令提示符(按照此说明)并执行git fetch
检索新分支的问题。
回答by XYZ
I had the exact opposite issue (more or less): I could see the branch in Visual Studio, but it wasn't on the remote server.
我遇到了完全相反的问题(或多或少):我可以在 Visual Studio 中看到分支,但它不在远程服务器上。
Trying to delete it (from remote) yielded this error:
尝试删除它(从远程)产生了这个错误:
Error encountered while pushing to the remote repository: Git failed with a fatal error. PushCommand.ExecutePushCommand
推送到远程存储库时遇到错误:Git 因致命错误而失败。推送命令.执行推送命令
Here's how to fix it (tested in VS 2017):
以下是修复它的方法(在 VS 2017 中测试):
- In Visual Studio, double click on your "rogue" remote branch;
- VS should have now created a local branch from it;
- Right click on the local branch, select "Unset remote branch";
- Right click on the local branch, select "Push branch";
- You should now have a truecorresponding remote branch;
- Delete the remote branch, then the local branch.
- 在 Visual Studio 中,双击您的“流氓”远程分支;
- VS 现在应该已经从它创建了一个本地分支;
- 右键单击本地分支,选择“取消设置远程分支”;
- 右键单击本地分支,选择“推送分支”;
- 你现在应该有一个真正对应的远程分支;
- 删除远程分支,然后删除本地分支。
Hopefully it will help someone who ends up on this thread having the same issue as me.
希望它会帮助那些最终在这个线程上遇到与我相同问题的人。