4

I'm working on a project with a few different branches and I began using Git in VS Code to make things easier and remain in my text editor (I know I can bring in a command line in VS Code but I'm a visual person and prefer the extension).

For the first time today it was time to merge a branch I call "features" into my master. I use the command "Git: merge branch". It does a quick load and then nothing else happens. I switch branches and nothing has merged. I have read through the VS Code documentation and there is nothing on this as well as searched through different threads here but I can't find anything that relates to this. Does anyone know how to fix this? Or am I missing something super basic??

1
  • 1
    Are you master or your feature branch when trying to merge? You should git checkout master then git merge feature Commented Apr 5, 2019 at 2:35

3 Answers 3

5

Check the Git History VSCode plugin in order to have a visual representation of what is going on: when a merge does not yield the expected result, you must see the logs of all the branches and check how said branches are related one to another.

merged branches

Typically, if one branch was already merged into another (as shown above), trying and merge it again won't do much (meaning it will be a nop)

Sign up to request clarification or add additional context in comments.

6 Comments

Thank you! So how do I find out how the branches are related to each other? I don't see any relation between them
@carlstrom96 From which branch feature has been created?
feature branch was created from the master branch
@carlstrom96 And after your merge, do you see it join again to master?
No that is the issue. When I merge, nothing is happening. I hit the command git: merge branch, then nothing happens and I'm not sure why.
|
1

I had the same question.

It just required a slight change of how I was looking at the issue (being new to .git).

The key was to checkout the Main Branch first, and then to Merge the Feature branch back into it (I was trying to merge the feature into the main and it didn't work).

Hope this helps any future noob who finds this post :)

Comments

0

I'm pretty sure your are not on the right branch.

Like with the command line, you want to merge from/to.

So taking you features branch example, you commit what you need to that branch, then checkout to master (Command Palette > Git Checkout) and then you will be able to merge features into master.

That's a Git design, nothing to do with the VSCode integration, they could warn you that you are trying to merge into the same branch to be fair

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.