Merging branches with Git in IntelliJ IDE

You normally have two merge use cases.

  1. First use case is as you have already described: there are no changes in the master branch. In this case the merge is pretty easy, see the steps on the picture below.

scenario_1

  1. Second use case is a bit complicated: there are some changes in the master branch. You want first update the master and the InlineEdit and then merge InlineEdit into master. See the steps on the picture below.

scenario_2


The standard workflow you are following goes something like this:

git checkout InlineEditing
# work work work
git commit -m 'finished my work'

# now switch to master and merge the feature branch into it
git checkout master
git merge InlineEditing
# resolve any merge conflicts; IntelliJ is great for this step

It might be slightly counterintuitive that you have to switch to master in order to merge another branch into it. Instead, you might have expected to be able to merge InlineEditing into master from the former branch. This is just how Git works.

With regard to your original question about IntelliJ, I think there is nothing wrong with using a GUI tool for Git, provided that you know what you are doing. I tend to do most Git operations from the command line, because I am experienced doing this and the command line is powerful. But there are many cases where I use tools like IntelliJ. For example, resolving merge conflicts is much easier in IntelliJ than the command line. Also, visualizing the history of a branch can be easier using a GUI tool.