简体   繁体   中英

Remote branch on Visual Studio online doesn't appear on Visual Studio 2015 Team Explorer

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.

This is my Visual Studio online: 在此处输入图片说明

And this is Visual Studio 2015 Team Explorer: 在此处输入图片说明

Why develop branch doesn't appear on Team Explorer?

You can now do this in Visual Studio by going to the Synchronisation tab (Sync in the Team drop down menu) and clicking Fetch at the top.

从菜单中选择同步,点击获取

我已经解决了打开Git命令提示符(遵循此说明 )并执行git fetch来检索新分支的问题。

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.

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

Here's how to fix it (tested in VS 2017):

  1. In Visual Studio, double click on your "rogue" remote branch;
  2. VS should have now created a local branch from it;
  3. Right click on the local branch, select "Unset remote branch";
  4. Right click on the local branch, select "Push branch";
  5. You should now have a true corresponding remote branch;
  6. Delete the remote branch, then the local branch.

Hopefully it will help someone who ends up on this thread having the same issue as me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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