ORIG_HEAD,FETCH_HEAD,MERGE_HEAD等 [英] ORIG_HEAD, FETCH_HEAD, MERGE_HEAD etc

查看:904
本文介绍了ORIG_HEAD,FETCH_HEAD,MERGE_HEAD等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有很多有用的git引用(这是什么名字? HEAD ORIG_HEAD FETCH_HEAD MERGE_HEAD ,@ {upstream}等。



有没有这方面的参考?一个完整的解释清单?

解决方案

git help revisions http://git-scm.com/docs/gitrevisions ,其中描述了所有的 / del>引用提交的最常用方法:


  • HEAD 命名提交
  • FETCH_HEAD 记录您从远程存储库中获取的分支,并使用您的最后一个git获取调用。
  • ORIG_HEAD 是由移动 HEAD 的命令创建的一个很重要的方法是在操作之前记录 HEAD 的位置,以便在运行之前轻松地将分支的顶端改回到状态。

  • MERGE_HEAD 会记录您在运行git merge时合并到您的分支中的提交。

  • CHERRY_PICK_HEAD 记录您在运行git cherry-pick时挑选的提交。



  • 从git源代码,您还可以了解 BISECT_HEAD REVERT_HEAD REJECT_NON_FF_HEAD 和其他几个你几乎肯定不需要的人。



    该引用还解释了后缀( ^ N 〜N @ {...} ),范围( .. vs ... )等等。


    There's a lot of useful git references (what is the exact name for this?), e.g. HEAD, ORIG_HEAD, FETCH_HEAD, MERGE_HEAD, @{upstream} etc.

    Is there any reference for this? A complete list with explanations?

    解决方案

    git help revisions brings up http://git-scm.com/docs/gitrevisions, which describes all the the most common ways to reference commits:

    • HEAD names the commit on which you based the changes in the working tree.
    • FETCH_HEAD records the branch which you fetched from a remote repository with your last git fetch invocation.
    • ORIG_HEAD is created by commands that move your HEAD in a drastic way, to record the position of the HEAD before their operation, so that you can easily change the tip of the branch back to the state before you ran them.
    • MERGE_HEAD records the commit(s) which you are merging into your branch when you run git merge.
    • CHERRY_PICK_HEAD records the commit which you are cherry-picking when you run git cherry-pick.

    From the git source, you can also find out about BISECT_HEAD, REVERT_HEAD, REJECT_NON_FF_HEAD and several others that you will almost certainly never need.

    That reference also explains suffixes (^N, ~N, @{...}), ranges (.. vs ...), and more.

    这篇关于ORIG_HEAD,FETCH_HEAD,MERGE_HEAD等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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