문제

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.

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top