Lost file after git merge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear all,

recently we experienced strange behavior of git merge after deleting file in two branches and introducing it again in one of them (revision graph: https://i.stack.imgur.com/jNUZB.png):

1. I added a file called 'new_file' to a master branch.
2. Then I created branch feature/2 and deleted the file in master
3. Then I deleted the file in branch feature/2 as well.
4. I created 'new_file' on branch feature/2 again.
5. I merged feature/2 into master, merge introduced no changes, file 'new_file' is not present in master.

This could cause problems to our team in the future, fortunately we noticed it this time.
Please, does anybody have any explanation for this behavior?

Or is anybody aware of any Git or Source option that changes this behaviour?

Thank you very much,

Lada Tesarik

P. S.
In the picture the steps were done with git revert command, but result is the same if I delete file manually and perform git commit.
Tested with git versions 2.26 and 2.37



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux