开发者

Command to find the git merge that undeleted a file

开发者 https://www.devze.com 2023-04-13 01:53 出处:网络
I recently discovered that, when merging into my branch, someone mistakenly undeleted a file I deleted earlier.

I recently discovered that, when merging into my branch, someone mistakenly undeleted a file I deleted earlier.

When I do a git log on the path to the deleted file, the delete and the merge that undeleted the file don't appear.

If I do:

git log deleted_sha..HEAD path_t开发者_开发知识库o_file

I can see there was one change (the source of the conflict that caused my delete to get clobbered). From here, it's easy to walk through the history until the bad merge.

What I'd like is a command to tell me in exactly what commit (i.e., the bad merge) the undelete happened.


This should give you just the merge commits that affected the file:

 git log deleted_sha.. --merges -- path/to/file
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号