Question

We use a single branch for all the users. Every time a user tries to push, he needs to pull others changes first. This results in a git automerge which works fine in most of the scenarios.

Yesterday, one of our users did the above and it resulted in a conflict, which failed the automerge. Now, the person resolved the conflicts and instead of committing all the files as part of this merge, committed and pushed only the conflicted file (after resolving them).

This has resulted in a situation, where all the files which he didn't commit are now being shown as old in the remote repo.

The changes are still there on his machine and we can also see them in git if we go to the file history but are not getting pulled.

Any way out of this?

BTW, we don't use --rebase or --ff-only options.

Was it helpful?

Solution

This is how I resolved this -

  • There were 5-6 commits on top of the erroneous commit.
  • We reverted those commits, along with the erroneous commit.
  • Committed and pushed the correct files again.
  • Replayed the commits reverted again.

I've asked another question here to understand why it should be this way.

Special Thanks to @eatSleepCode for this help in suggesting the solution.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top