ORIG_HEAD, FETCH_HEAD, MERGE_HEAD etc

前端 未结 4 1248
没有蜡笔的小新
没有蜡笔的小新 2020-12-04 13:26

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

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-04 13:31

    This is what the official Linux Kernel Git documentation for Git revisions says:

    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.

    Also, for @{upstream}:

    @{upstream}, e.g. master@{upstream}, @{u}

    The suffix @{upstream} to a ref (short form @{u}) refers to the branch the ref is set to build on top of. A missing ref defaults to the current branch.

提交回复
热议问题