Confirmed users
1,643
edits
| Line 377: | Line 377: | ||
# <span style="color:red">(Different with git-reset)</span> Change the referee(branch) of HEAD. | # <span style="color:red">(Different with git-reset)</span> Change the referee(branch) of HEAD. | ||
# <span style="color:red">(Different with git-reset)</span> There is no hardness-choice in git-checkout. git-checkout always modifies working directory and the index. | # <span style="color:red">(Different with git-reset)</span> There is no hardness-choice in git-checkout. git-checkout always modifies working directory and the index. | ||
# <span style="color:red">(Similar to git-reset-hard)</span> | # <span style="color:red">(Similar to git-reset-hard)</span> Regenerates index according to the tree of the new assigned commit; update working by the index. There are two place that git-reset-hard differs from git-checkout. The first one is git-reset-hard never aborting, while git-checkout will. Second, git-reset-hard simply overwrites all dirty tracked files from the tree; git-checkout, in other hand, does not care about whether a tracked file is dirty. git-checkout overwrites tracked files which content are different in origin and new tree. | ||
Scott Chacon/Ben Straub wrote a fantastic article with regards to reset, and deserves you spend time on: http://git-scm.com/blog/2011/07/11/reset.html | Scott Chacon/Ben Straub wrote a fantastic article with regards to reset, and deserves you spend time on: http://git-scm.com/blog/2011/07/11/reset.html | ||