如何从 visual studio 中的远程服务器查看新的 GIT 分支?

How to view the new GIT branch from remote server in visual studio?

我正在使用 visual studio 2017 和 GIT。

我可以连接到 GIT 项目,分支并拉取代码。

但是当在远程服务器上创建新分支时,在 visual studio 个分支部分看不到它。

如何从 visual studio 中的远程服务器查看新的 GIT 分支?

Team Explorer 视图 (you can see here) 应该会向您显示 remotes/origin 下的那些分支。

但您需要 fetch first,才能在该部分看到它们。

(图片来自“Git Fetch Upstream en Visual Studio 2017”)

(这是上游的示例,但在您的情况下,select origin

这假定您的本地存储库 uses the default refpect

[remote "origin"]
    url = https://github.com/schacon/simplegit-progit
    fetch = +refs/heads/*:refs/remotes/origin/*

这将获取 所有 个分支,包括在远程存储库中新创建的分支。