git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Lost file after git merge
@ 2022-07-28  8:23 Laďa Tesařík
  2022-07-28 12:17 ` Ævar Arnfjörð Bjarmason
  2022-07-28 21:23 ` brian m. carlson
  0 siblings, 2 replies; 9+ messages in thread
From: Laďa Tesařík @ 2022-07-28  8:23 UTC (permalink / raw)
  To: git@vger.kernel.org

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-07-31  1:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-07-28  8:23 Lost file after git merge Laďa Tesařík
2022-07-28 12:17 ` Ævar Arnfjörð Bjarmason
2022-07-28 17:11   ` Junio C Hamano
2022-07-29 20:23     ` René Scharfe
2022-07-29 22:04       ` Junio C Hamano
2022-07-30  2:16       ` Elijah Newren
2022-07-30 14:44         ` René Scharfe
2022-07-31  1:45           ` Elijah Newren
2022-07-28 21:23 ` brian m. carlson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).