使用 Visual Studio Online 创建远程 GIT 分支

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

Create remote GIT branch with Visual Studio Online

gitvisual-studio-2015azure-devops

提问by adova

I am implementing a GIT repository in Visual Studio Online (and VS 2015 pro) and I am trying to implement a branching strategy that requires multiple remote branches. So, given that I start with "origin/master", I would like to branch off of that and have "origin/development".

我正在 Visual Studio Online(和 VS 2015 pro)中实现一个 GIT 存储库,并且我正在尝试实现一个需要多个远程分支的分支策略。因此,鉴于我从“起源/主”开始,我想从中分出“起源/发展”。

I am guessing that I might be able to accomplish this with a command line, but is there a way to do this with VSO? Does this all even make sense, lol? I am obviously new to GIT.

我猜我可以用命令行来完成这个,但是有没有办法用 VSO 来做到这一点?这一切都有意义吗,哈哈?我显然是 GIT 的新手。

回答by Eddie Chen - MSFT

Yes, you can do this from VS and VSO.

是的,您可以从 VS 和 VSO 执行此操作。

From VS:

来自 VS:

  1. Open “Branches” from Team Explorer.
  2. Right click on the project you'd like to branch and select “New local branch from…” to create a local branch.
  3. Right click on the new created branch and select “Publish Branch” to publish the local branch to your VSO Remote Repository.

    NOTE: In VS 2017+ it now says "Push Branch" instead of "Publish Branch"

  1. 从 Team Explorer 打开“Branches”。
  2. 右键单击要分支的项目,然后选择“从...新建本地分支”以创建本地分支。
  3. 右键单击新创建的分支并选择“发布分支”将本地分支发布到您的 VSO 远程存储库。

    注意:在 VS 2017+ 中,它现在显示“推送分支”而不是“发布分支”

From VSO:

来自 VSO:

  1. Open your project from VSO Web Portal.
  2. Click “Code” panel.
  3. Click branch dropdown and select New Branch to create a branch. enter image description here
  1. 从 VSO Web 门户打开您的项目。
  2. 单击“代码”面板。
  3. 单击分支下拉菜单并选择新建分支以创建分支。 在此处输入图片说明