Git with Visual Studio

2017/6/301 min read
bookmark this

Common Issue with Git Visual Studio

Merge or Commit error

If you're using Visual Studio Git.Merge code from source branch to target branch and there's new commit at target branch, you might see following error.

An error occurred. Detailed message: 2 uncommitted changes would be overwritten by merge

You'll probably still see this error after try couple time pull operation from target branch. I think this might be a bug for using Visual Studio git, but some people saying it might be file be locked, anyway it is something should working but git VS is not doing correctly. So following are the fix I have tried and works so far.

  1. After check out to target branch always pull first then do other operation like merge or push. 
  2. #1 although most of the time should work fine, however, if you forgot to pull or even after you pull someone to push their you might still see above error. 
    1. Restart Visual Studio, this might works
    2. Open command line from your current source folder and type following. 
      git status
      git pull