Git Merge in Visual Studio 2019 v16.9.2

Albertk 106 Reputation points
2021-03-31T07:01:31.407+00:00

I have a master/Main branch which is the default and also a branch called "version2". Is it possible to merge Version2 to the master. I don't seems be able to find the option. Any Help would be appreciated. Thank you.

Developer technologies | Visual Studio | Other
{count} vote

Accepted answer
  1. Peter Toye 191 Reputation points
    2021-04-21T09:15:51.897+00:00

    @Albertk
    The workaround I've found is to use Git outside of VS. I agree this is a pain, but MS seem to have a very one-dimensional view of how you should use Git.

    I installed Git-Bash some time ago and the commands

    git checkout master  
    git merge version2  
    

    should work on your local repository.

    You probably should close down VS (or at least the project) before doing this - I've not tried with VS open in case it breaks something.

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Ken Tucker 5,861 Reputation points
    2021-03-31T09:57:40.763+00:00

    With GIT you need to create a Pull Request to merge your code into another branch in the remote repository

    https://devblogs.microsoft.com/devops/conduct-a-git-pull-request-on-visual-studio-online/#:~:text=Open%20the%20web%20portal.%20In%20your%20web%20browser%2C,Reviewers%20make%20comments%20on%20specific%20lines%20of%20code.

    Locally in the Git changes window make the active branch the branch you want to merge into. At top of the window is a drop down list a list of branches hit the arrow at the right hand side of the branch you want to merge from. In the list that shows select merge into current branch


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.