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?
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.
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…”.
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.
`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.
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)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With