在 Visual Studio Code 中如何合并两个本地分支? [英] In Visual Studio Code How do I merge between two local branches?

查看:122
本文介绍了在 Visual Studio Code 中如何合并两个本地分支?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 Visual Studio Code 中,我似乎只被允许推送、拉取和同步.有文档支持合并冲突,但我不知道如何在两个分支之间实际合并.VSC 中的 Git 命令行(按 F1)仅提供了一部分命令:

尝试从备用分支拉取或推送到备用分支会产生:

这是关于 VSCode 的 Git 的文档

从1.18开始,结合merge命令(1.14)合并标记(1.18),你真的可以在分支之间进行局部合并.


2016 年的原始答案:

版本控制文档没有提到合并命令,只提到合并状态和冲突支持.

即使 6 月 1.3 日最新发布也没有为 VCS 带来任何新内容前面.

这是由 issue 5770 支持的,它确认您不能将 VS Code 用作 gitmergetool,因为:

<块引用><块引用>

这个功能是否会被包含在下一次迭代中?

可能不是,这是一项巨大的努力,因为需要实现合并 UI.

这使得实际的合并只能从命令行启动.

In Visual Studio Code it seems that I am only allowed to push, pull and sync. There is documented support for merge conflicts but I can't figure out how to actually merge between two branches. The Git command line within VSC (press F1) only facillitates a subset of commands:

Attempting to pull from a an alternate branch or push to an alternate branch yields:

Here's the documentation on VSCode's Git Visual Studio Code Git Documentation

What am I overlooking?

解决方案

Update June 2017 (from VSCode 1.14)

The ability to merge local branches has been added through PR 25731 and commit 89cd05f: accessible through the "Git: merge branch" command.
And PR 27405 added handling the diff3-style merge correctly.

Vahid's answer mention 1.17, but that September release actually added nothing regarding merge.
Only the 1.18 October one added Git conflict markers

From 1.18, with the combination of merge command (1.14) and merge markers (1.18), you truly can do local merges between branches.


Original answer 2016:

The Version Control doc does not mention merge commands, only merge status and conflict support.

Even the latest 1.3 June release does not bring anything new to the VCS front.

This is supported by issue 5770 which confirms you cannot use VS Code as a git mergetool, because:

Is this feature being included in the next iteration, by any chance?

Probably not, this is a big endeavour, since a merge UI needs to be implemented.

That leaves the actual merge to be initiated from command line only.

这篇关于在 Visual Studio Code 中如何合并两个本地分支?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆