Confirmed users
1,643
edits
| Line 310: | Line 310: | ||
<div style="background-color: rgba(250, 255, 240, 1); border-style:dashed; border-width:1px;border-color:grey"> | <div style="background-color: rgba(250, 255, 240, 1); border-style:dashed; border-width:1px;border-color:grey"> | ||
<center>'''Note'''</center> | <center>'''Note: what is <tree-ish>'''</center> | ||
The definition of <tree-ish> at [[https://www.kernel.org/pub/software/scm/git/docs/ git-mamual-page]] | |||
'''<object>''' indicates the object name for any type of object. | '''<object>''' indicates the object name for any type of object. | ||
| Line 322: | Line 324: | ||
'''<commit-ish>''' indicates a commit or tag object name. A command that takes a <commit-ish> argument ultimately wants to operate on a <commit> object but automatically dereferences <tag> objects that point at a <commit>. | '''<commit-ish>''' indicates a commit or tag object name. A command that takes a <commit-ish> argument ultimately wants to operate on a <commit> object but automatically dereferences <tag> objects that point at a <commit>. | ||
Here are all valid examples of get-reset-commit | |||
$ git reset master -- README.txt | |||
$ git reset master^ -- README.txt | |||
$ git reset HEAD -- README.txt | |||
$ git reset v1.0 -- README.txt # v1.0 is a tag name | |||
$ git reset 0a11f0 -- README.txt # 0a11f0 is the name of a commit object | |||
$ git reset 0b7123 -- README.txt # 0b7123 is the name of a tree object | |||
$ git reset refs/heads/master -- README.txt | |||
In short, a tree-ish is a thing that lead to a specific tree object. | |||
</div> | </div> | ||