Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

In Visual Studio Code How do I merge between two local branches?

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:

eGit options available in VSCode

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

git Command throttling

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

What am I overlooking?

like image 934
TheFastCat Avatar asked Jul 29 '16 00:07

TheFastCat


People also ask

How do I merge local branches in Visual Studio?

To do the same in Visual Studio, check out the feature branch by double-clicking it in the branch list. Then right-click main and select Merge 'main' into 'New_Feature'. To do the same in Visual Studio, check out the feature branch by double-clicking it in the branch list.

How do I merge changes from one branch to another in code?

Merging branches in Visual Studio Code is a little less obvious than other actions. There doesn't seem to be an option to merge in the context menus, so you'll have to use the command palette ( ctrl+shift+p ) to find the command by typing “merge” and ultimately selecting “Git: Merge Branch…”.

How do you combine branches?

First we run git checkout master to change the active branch back to the master branch. Then we run the command git merge new-branch to merge the new feature into the master branch. Note: git merge merges the specified branch into the currently active branch.

Which command is used to merge two branches?

`git merge` command is used for this task. This command finds out the common base commit command by examining the two commit pointers of the merging branches and generates a new merge to combine the changes after running the command.


1 Answers

You can do it without using plugins.

In the latest version of vscode that I'm using (1.17.0) you can simply open the branch that you want (from the bottom left menu) then press ctrl+shift+p and type Git: Merge branch and then choose the other branch that you want to merge from (to the current one)

like image 134
Vahid Avatar answered Oct 07 '22 14:10

Vahid