Tools, VIM

Git Commit Weirdness

Sometimes when we pull from upstream origin in terminal, we see git prompting to enter vim. And if we left it hanging there and went ahead committing somewhere else, it would treat all those changes in master as your own contribution, because merge didn’t happen before commit.

Solution:

If you’re already in the mess:

$ git reset --hard

Pull from upstream again, actually entering vim this time, getting out, and commit.

 

If you still have VIM open:

  • Do not close VIM
  • Go resolve the conflict
  • Add the files in git
  • Then save and close the VIM window

Changes should be auto-committed at this point.

Standard