Search code examples
gitversion-controlgithubmsysgitgit-extensions

Git Extensions has pending changes that aren't my own?


This question might be a long shot because I still cannot reliably duplicate the issue but it has happened to several of my coworkers on many occasions and it still baffles me.

Occasionally Git Extensions (on Windows 7) will show pending changes in their working directory that are not their own after they commit and do a push. The push fails because it says they have pending changes, despite the fact that they just barely committed all their pending changes before the push. This is the point when I get called over. Upon examination of the changes they are changes that were made by another committer and pushed up to origin. A couple times the changes have even been changes that were done by me.

Devloper A (we'll call Bob) goes ahead and makes a series of changes to his repository. Bob then commits those changes and pushes the commit up to origin.

Developer B (w'll call Fred) also makes some changes and commits them to his repository. Fred then tries to push those changes up to origin. At this point I would expect Fred to get an error saying that his repository is behind origin by 1 commit and tell him to do a pull first. However, the error he gets says the push failed because he has pending changes in his working directory. When Fred looks at the pending changes he sees that all the changes are actually the changes made in Bob's commit.

When Fred commits those changes as if they were his own then all seems well. Nothing breaks from it but it's extremely bizarre when it happens. I have yet to see what happens if we try to undo the pending changes because I am afraid the changes will essentially be reverted if we did that.

Has anyone else ever experienced this odd behavior with Git or Git Extensions?

Update

I found an instance in our project history where this happened. Both commits have the same exact changes to the same number of files, but the commits are done by two different developers.

Here is Bob's original commit: And here is Fred's wonky commit: Edit: Just to clarify, Fred meant to type "push changes" as the commit message because it was the act of trying to push (not pull) that caused the mysterious pending changes to appear.


Solution

  • Can you copy and post the error message, when it happens next time? Content of Help -> Git command log would be also helpful. Does Fred have checked Auto pull on rejected option (FormPush -> Advanced options)?