git 如何在 Visual Studio 2015 中创建一个新分支?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/30413834/
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:02:16  来源:igfitidea点击:

How to make a new branch in Visual Studio 2015?

gitvisual-studiobranchgit-branch

提问by b0x0rz

I am using Git with Visual Studio Online in Visual Studio 2015 and am trying to figure out how to create a branch.

我在 Visual Studio 2015 中将 Git 与 Visual Studio Online 一起使用,并试图弄清楚如何创建分支。

This is the usual answer on the internet: https://msdn.microsoft.com/en-us/library/hh850437.aspx& https://msdn.microsoft.com/en-us/library/jj190809.aspx#create

这是互联网上的常见答案:https: //msdn.microsoft.com/en-us/library/hh850437.aspx& https://msdn.microsoft.com/en-us/library/jj190809.aspx#create

If you check the image it shows the branch and the drop down arrow where I assume you can create a branch. But in Visual Studio 2105 the dropdown is not there and when I click on the link it goes to branches.

如果您检查图像,它会显示分支和下拉箭头,我假设您可以在其中创建分支。但是在 Visual Studio 2105 中,下拉菜单不存在,当我单击链接时,它会转到分支。

But there is only Merge, Rebase, and Actions dropdowns. There is no new branch.

但只有 Merge、Rebase 和 Actions 下拉菜单。没有新的分支。

So how can I create a new branch in Visual Studio 2015?

那么如何在 Visual Studio 2015 中创建一个新分支呢?

回答by Terje Sandstr?m

Just look one further down in the branches hub. You see it has Active Git Repositories, and presumably showing yours. It can be opened, and show your master branch. Right click that one, and you get a context menu including "New Local Branch from..."

只需在分支机构中心进一步向下看。您会看到它具有 Active Git 存储库,并且大概显示了您的。它可以打开,并显示您的主分支。右键单击那个,你会得到一个上下文菜单,包括“来自...的新本地分支”

回答by GBPhilip

I had the same problem that the select branch was empty, the create branch was disabled and I had win10 anniversary. Then I realised I hadn't committed anything locally. Once I had the button and drop down became active.

我遇到了同样的问题,select 分支是空的,create 分支被禁用,我有 win10 周年纪念日。然后我意识到我没有在本地做任何事情。一旦我有了按钮,下拉菜单就变得活跃了。