0

We had a situation where a lot of my code that was written over the weekend was wiped out this past Monday when a user did not push a merge that was merged on last Friday 11/6/2020.

The situation:

  1. User pulled a branch around noon on 11/6/2020.
  2. He made the changes he needed to over the 4 hours and then before 5pm on 11/6/2020, he merged into the dev line we have. He DID finish the merge (we assume), but did not PUSH the merged changes.
  3. I continued to work on my other branch from Thursday 11/5/2020 until Sunday 11/8/2020. I then merged my changes into the dev line remote and everything went fine and we pushed to Test/Demo without any issues.
  4. The user noticed his changes were not in our Test/Demo environments. He then realized he did merge in, but never did a PUSH. He completed that push around 9:40am on 11/9/2020 and it wiped out all of my changes from the weekend. (Note: All, I think he just pushed it via VS and not the command line. So not sure what command is tied to the push in VS 2019?)
  5. Around 3pm on Monday 11/9/2020, I realized all my changes from the weekend were gone and started researching what happened.

We were able to revert everything by doing a cherry pick on all of my commits from the Thursday 11/5/2020 until Sunday 11/8/2020 (about 19 of them). Everything is good. We are trying to figure out what happened though.

Why would the PUSH he did on Monday 11/9/2020, cause this to be wiped out? Should he have done something else before actually committing the PUSH since it was delayed? I mean I usually 'Commit all and sync' after completing the merge to the dev line remote.

Update: All, I think he just pushed it via VS and not the command line. So not sure what command is tied to the push in VS 2019?

ttaylor27272727
  • 195
  • 3
  • 18
  • did he force push his branch? – Joe Nov 13 '20 at 14:19
  • Sounds like the other dev has forced push. – Liam Nov 13 '20 at 14:19
  • 1
    The problem there is that the other developer force-pushed. That should not happen because.... guess: you remove other people's changes. Does it sound familiar? If the user notices that a normal push fails because there are other changes in the branch, they can either merge again (after fetching, of course), or they can rebase what they did... in other words, normal flow. – eftshift0 Nov 13 '20 at 14:20
  • Does this answer your question? [How can I recover from an erronous git push -f origin master?](https://stackoverflow.com/questions/3973994/how-can-i-recover-from-an-erronous-git-push-f-origin-master) – Liam Nov 13 '20 at 14:20
  • All, I made an update. If he did force push his branch, what would that mean? – ttaylor27272727 Nov 13 '20 at 15:51
  • Thanks, everyone for your input. We can't recreate it and find out why it occurred. Hopefully, it will not happen again. – ttaylor27272727 Nov 13 '20 at 21:33

0 Answers0