git-某些文件不是在远程最近提交的

时间:2019-03-18 23:48:08

标签: git merge version-control gitlab

我们的git存储库似乎正在“忽略”我们一段时间内推送的某些提交。我可以在提交历史记录中看到它们,但是当打开/拉出实际文件时,它似乎是在较早的提交中。

遥控器是我们大学托管的Gitlab。我和我的队友都没有回想起做任何不寻常的事情,并且在存储库历史记录中也没有发现异常。我们只有一个远程分支(主)。

我在上周四进行并提交了提交,然后队友A立即从存储库中提取了内容,并提取了我刚刚推送的更改。之后,队友B进行了两次提交。根据{{​​1}}和Gitlab中显示的历史记录,Teammate B的提交不影响我在较早的提交中更改的文件。但是,当我和队友A都跟随队友B的提交进行撤消操作时,文件被先前的提交覆盖。

示例:

  1. 有关受影响文件之一的提交历史记录 Commit history for one of the affected files

最新的提交是git show,但是当我们从远程拉出时,我们得到的是9c53751e

  1. 同一时间段内同一文件的git日志输出

b690a169

提交 commit b690a169b9293d41cd0aa7c0984cc5800aa7dc6b Author: redacted - author Date: Thu Mar 14 00:28:31 2019 +0000

redacted - commit message

commit b8ecd472ce00dd71f7fd182a6fac687e7a1127b8 Author: redacted - author Date: Mon Mar 11 20:41:16 2019 +0000

redacted - commit message

commit 19a93adaa7c8f5cf0bafb9af2ad053cff8113419 Author: redacted - author Date: Sat Feb 23 23:52:06 2019 +0000

redacted - commit message

commit f0f1a60d57e54d1b5148f4c163d26275d947c9e8 Merge: a307998 0d0dd67 Author: redacted - author Date: Sat Feb 23 16:09:35 2019 +0000

:...skipping... commit b690a169b9293d41cd0aa7c0984cc5800aa7dc6b Author: redacted - author Date: Thu Mar 14 00:28:31 2019 +0000

redacted - commit message

commit b8ecd472ce00dd71f7fd182a6fac687e7a1127b8 Author: redacted - author Date: Mon Mar 11 20:41:16 2019 +0000

redacted - commit message

commit 19a93adaa7c8f5cf0bafb9af2ad053cff8113419 Author: redacted - author Date: Sat Feb 23 23:52:06 2019 +0000

redacted - commit message

commit f0f1a60d57e54d1b5148f4c163d26275d947c9e8 Merge: a307998 0d0dd67 Author: redacted - author Date: Sat Feb 23 16:09:35 2019 +0000

redacted - commit message

commit a30799825ca0776513fd62468fca436bcaa04ab7 Author: redacted - author Date: Sat Feb 23 13:17:58 2019 +0000

redacted - commit message

commit 0d0dd67664c63905f3b3a4061a1690a86d5da117 Author: redacted - author Date: Thu Feb 21 12:30:53 2019 +0000

redacted - commit message

commit 280e11a7315e761440f38257cdffdbd79ea77513 Author: redacted - author Date: Sun Feb 17 15:24:04 2019 +0000

redacted - commit message

commit 61bbc6da1e1e22f42df1f9b0141dabdaf3b132e5 Author: redacted - author Date: Sun Feb 17 12:21:38 2019 +0000

redacted - commit message

不在此文件的git日志中的任何位置。但是,我发现有些提交重复出现(在从顶部开始的第4次提交之后重复出现)很有趣。

  1. 整个存储库的git日志

9c53751e

在此git日志中,最近的两次提交是Teammate B所做的提交。“丢失”的提交

commit f52a9891dce9d1fc04287a0cc036ba7a6abfe490 Merge: 37f2c7a 9c53751 Author: Teammate B Date: Fri Mar 15 12:10:29 2019 +0000

redacted - commit message

commit 37f2c7a2da1c7154edc25542b831cf47e602c779 Author: Teammate B Date: Fri Mar 15 09:52:12 2019 +0000

redacted - commit message

commit 9c53751e8b6edf6222f3dd7117b0ebf3a640bc68 Author: Me Date: Thu Mar 14 21:27:33 2019 +0000

redacted - commit message

commit 1c9eb7142a69e67e5c5459a4366dd125c9a85696 Merge: cb01aa8 669d5d1 Author: redacted - author Date: Thu Mar 14 21:22:58 2019 +0000

redacted - commit message

commit cb01aa82a1a5ab6b311e7cd97a1add29217df2c7 Author: redacted - author Date: Thu Mar 14 21:22:48 2019 +0000

redacted - commit message

commit 669d5d143e4b2f3734f0cdabc98ade0914f6d2ea Author: redacted - author Date: Thu Mar 14 21:02:26 2019 +0000

redacted - commit message

commit 8117b7b68cdb4763728eb93acfc476d2ffc47a3b Author: redacted - author Date: Thu Mar 14 20:52:02 2019 +0000

redacted - commit message

commit ac8429422a1eb5698e772efa0fe7d513cf35d41b Author: redacted - author Date: Thu Mar 14 20:18:13 2019 +0000

redacted - commit message

确实出现在这里。队友B的提交未影响任何受9c53751e影响的文件(已使用9c53751e进行了验证),但是git show f52a9891dce9d1fc04287a0cc036ba7a6abfe490被列为合并父对象。

在星期五进行的所有提交和推送,之后按预期工作,远程指向最新的提交。其中包括受上述问题影响的文件。

我怀疑这是合并错误,但是奇怪的是在历史记录中找不到任何信息。还有其他我可以运行的git命令来提供一些解释吗?无需手动浏览每个文件的历史记录并将它们缝合在一起,是否有任何方法可以还原这些提交?

0 个答案:

没有答案