简体   繁体   English

如何在 Visual Studio 中从远程服务器查看新的 GIT 分支?

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

I am using visual studio 2017 and GIT.我正在使用 Visual Studio 2017 和 GIT。

I can connect to the GIT project, branch and pull the code.我可以连接到 GIT 项目,分支并拉取代码。

But when a new branch is created on remote server, it cannot be seen in visual studio branches section.但是当在远程服务器上创建一个新分支时,它在 Visual Studio 分支部分是看不到的。

How to view the new GIT branch from remote server in visual studio?如何在 Visual Studio 中从远程服务器查看新的 GIT 分支?

The Team Explorer view ( you can see here ) should show you those branches under remotes/origin . Team Explorer 视图( 您可以在此处查看)应该向您显示remotes/origin下的那些分支。

But you need to fetch first , before being able to see them in that section.但是您需要先获取,然后才能在该部分中看到它们。

http://sofes.miximages.com/git/nBNIR.png

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

(this is an example for upstream, but in your case, select origin ) (这是上游的示例,但在您的情况下, select origin

This assumes your local repository uses the default refpect这假设您的本地存储库使用默认的 refpect

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

That would fetch all branches, included newly created ones on the remote repository.这将获取所有分支,包括远程存储库中新创建的分支。

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

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