所有git提交列表? [英] List of all git commits?

查看:90
本文介绍了所有git提交列表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我有这样的图表:

  A --- B --- C --- D (master)
\
\ -E --- F(HEAD)

如果我做了 git log --all --oneline ,我将得到我所有的六次提交。



<但是如果图表是

  A --- B --- C --- D(master,HEAD)
\
\ -E --- F

我不会看到E和F.我可以让git告诉我所有的提交,包括那些没有被命名的分支上的提交吗?

谢谢

不是特别容易 - 如果你失去了指向枝头的指针,那就好像在大海捞针中寻找针。你可以找到所有看起来不再被引用的提交 - git fsck --unreachable 会为你做这件事 - 但那将包括你扔掉的提交在> git commit --amend 之后,旧分支上的旧提交等等。因此,一次查看所有这些提交很有可能涉及太多的信息。 / p>

因此,轻浮的答案是,不要忘记你感兴趣的事情。更严重的是,reflog会持有对你用来提交的所有提交的引用最近60天左右默认。更重要的是,他们会给出一些关于这些提交 的内容。


Let's say that I have a graph like this:

A---B---C---D (master)
     \
      \-E---F (HEAD)

If I do git log --all --oneline, I will get all six of my commits.

But if the graph is

A---B---C---D (master, HEAD)
     \
      \-E---F

I will not see E and F. Can I get git to tell me all the commits, including those on branches which are not named?

Thanks

解决方案

Not particularly easily- if you've lost the pointer to the tip of a branch, it's rather like finding a needle in a haystack. You can find all the commits that don't appear to be referenced any more- git fsck --unreachable will do this for you- but that will include commits that you threw away after a git commit --amend, old commits on branches that you rebased etc etc. So seeing all these commits at once is quite likely far too much information to wade through.

So the flippant answer is, don't lose track of things you're interested in. More seriously, the reflogs will hold references to all the commits you've used for the last 60 days or so by default. More importantly, they will give some context about what those commits are.

这篇关于所有git提交列表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆