Cjku/git: Difference between revisions

Jump to navigation Jump to search
Line 379: Line 379:
checkout a branch means
checkout a branch means
# <span style="color:red">(Different with reset)</span> Change the referee(branch) of HEAD.
# <span style="color:red">(Different with reset)</span> Change the referee(branch) of HEAD.
# <span style="color:red">(Similar to reset --hard)</span> Regenerate index according to the tree of the new assign commit object; Overwrite all '''modified''' tracked files in working directory. The only difference between git-reset-hard and git-checkout is git-reset-hard never aborting, but git-checkout will.(Note: only tracked and dirty files will be overwritten by git-checkout. Unchanged files and untracked files are out of scope. checkout-aborting has direct relation with this principle).
# <span style="color:red">(Similar to reset --hard)</span> Regenerate index according to the tree of the new assign commit object; Overwrite all '''modified''' tracked files in working directory. The only difference between git-reset-hard and git-checkout is git-reset-hard never aborting, while git-checkout will.(Note: only tracked and dirty files will be overwritten by git-checkout. Unchanged files and untracked files are out of scope. checkout-aborting has direct relation with this principle).


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
Confirmed users
1,643

edits

Navigation menu