git“丢失”了我的提交,有点,日志给出了相互矛盾的结果
这里有一些非常奇怪的东西我无法弄清楚。
昨晚我提交了一些文件。
今天午餐时间左右,我意识到文件已经“丢失”了我昨天所做的所有更改。
我回顾了 git log 结果,果然提交就在那里。我通过执行 git diff 检查了内容,并且提交包含更改。但是......
如果我执行 git log,我可以在所有提交列表中看到该提交。如果我对提交中的其中一个文件执行提交日志,我会看到除了昨晚的提交之外的所有提交。如果我执行 git show 来显示提交中的文件,则特定文件就在那里。 Sooooo
git log - 显示提交 git show - 显示提交中的文件 git 日志文件 - 列出除我感兴趣的之外的所有提交!
我也不知道如何判断是什么杀死了已提交的更改。
有人有任何线索吗?我喜欢 git,但有时搞清楚它真的很痛苦。
Something really strange here I cannot figure out.
Last night I committed some files.
About lunch time today I realised that the files has "lost" all the changes I'd committed yesterday.
I went back through the git log results and sure enough the commit was there. I checked the contents by doing a git diff and the commit contains the changes. However ....
If I do a git log I can see the commit in the list of all commits. If I do a commit log on one of the files in the commit, I see every commit except the one from last night. If I do a git show to display the files in the commit the specific file is there. Sooooo
git log - shows the commit
git show - shows the files in the commit
git log file - list every commit but the one I'm interested in !!
I also cannot figure out how to tell what killed the committed changes.
Anyone got any clues? I like git, but it's a real pain in the rear to figure out sometimes.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试对目录进行 git checkout 并查看是否有任何效果。如果这不能更新它们,请删除它们,然后对文件进行 git checkout。
Try to do a git checkout on the directory and see if that has any effect. If that doesn't update them, delete them and then do a git checkout on the files.
确保您在使用 分离头。
(
git Branch --all
不会提及任何当前分支)提交将是在那里,但无法从分支机构访问。
Make sure you haven't committed those files while being on a detached head.
(
git branch --all
would not mention any current branch)The commit would be there, but not accessible from a branch.