Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[concept] ORIG_HEAD, FETCH_HEAD, MERGE_HEAD etc #65

Open
dorawyy opened this issue Nov 5, 2017 · 0 comments
Open

[concept] ORIG_HEAD, FETCH_HEAD, MERGE_HEAD etc #65

dorawyy opened this issue Nov 5, 2017 · 0 comments
Labels

Comments

@dorawyy
Copy link
Owner

dorawyy commented Nov 5, 2017

ORIG_HEAD, FETCH_HEAD, MERGE_HEAD etc - stackoverflow

git help revisions brings up gitrevisions documentation, 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant