我已經搜索了我的歷史記錄,但一無所獲。我可以在創建和修改它的地方看到提交,但它不再存在,我無法確定它被刪除的位置。文件不再位於HEAD修訂版本中,但無法找到文件被刪除的提交
例如:
git log --full-history --all --diff-filter=D --summary -- path/to/file
回報什麼。此外,只是爲了確保我的工作拷貝是不是莫名其妙地不同步的git的狀態(這甚至可能?)我想:
git checkout -- path/to/file
我也曾嘗試* *地段日誌命令。我檢查了github(repo託管在哪裏),而且文件也不是這樣。我檢查,以確保最後提交我可以找到該文件是完全合併,並且它是(git branch --merged
包含分支與文件)
我知道合併提交似乎並沒有顯示更改的日誌,是有可能我在某個合併過程中意外刪除了這些文件?或者這仍然會出現在日誌中?有沒有辦法在合併提交上獲取一些日誌信息?
更新:
這裏是這個命令的(有刪節)輸出:
git log --oneline -p -M --follow HEAD -- path/to/file
aaaaa this commit creates it again ?
diff --git a/path/to/file b/path/to/file
new file mode 100644
index 0000000..3333333
--- /dev/null
+++ b/path/to/file
bbbbb this commit modifies it
diff --git a/path/to/file b/path/to/file
index 1111111..2222222 100644
--- a/path/to/file
+++ b/path/to/file
ccccc this commit creates the file
diff --git a/path/to/file b/path/to/file
new file mode 100644
index 0000000..11111111
--- /dev/null
+++ b/path/to/file
保持簡單。當你做什麼時會發生什麼'git log --oneline - path/to/file'? – jthill
@jthill它顯示了一個提交(我將文件添加回樹中的提交) – quinn
@jthill如果我在提交之前立即簽出提交,則「--oneline」命令不輸出任何內容。如果我執行'git log --oneline --follow HEAD - path/to/file',它會顯示創建該文件的1個提交以及修改後的第二個提交。仍然沒有刪除提交。文件的日誌中也沒有任何證據被重命名。 – quinn