Normally, you get this error message when you are performing GIT operations from two different places. Like I got this issue while I was using Git Bash (Command Line) & Visual Studio together to perform Git operations.
mergesession is going on in one of the two instances of GIT. i.e. Git Bash & Visual Studio Git.
merge session in one of the two opened instances.
Note: When I got this error message, I found that a window with commit message text-box was opened in Visual Studio. I just entered the commit message & committed the code. Later I also closed Git Bash window as well.