Command: <> indicates an optional fill in [] represent the options must be filled in () represents an equivalent replacement for the () in content
1. Scratch related commands (the first three commands most commonly used)
git add [file] submitted a file to the staging area ([file] can be a file or directory name)
git add -A <path> commit all changes to the staging area, will be omitted <path>
. FIG. (i.e., the current directory)
git add. Submit a new file and the file has been modified (not including the deleted files) to the staging area
git add -u <path> submission be modified and deleted files (not including the new file) to the staging area, omit <path>
representation. (ie, the current directory)
git add -i <path>
View all being modified but not submitted or file has been deleted, and through it
revert
you can view sub-command
<path>
in all untracked files, and it will enter a sub-command system.
2. submit command (the first command the most used)
(1) in the revocation code is modified workspace
git checkout - [file] to discard a file this revision
git checkout -. all discarded
Note: git checkout - all discarded, including: new files are deleted, deleted files will be restored back, the modified file will go back. Some say this premise is back to what it was before staging area. Have any impact on the code before you save it in a temporary area where not. Code commit to submit to the local branch did not even affect the
(2) Code git add to the buffer zone, did not commit the
git reset HEAD [file] to discard a file of this staging
git reset HEAD. discard all
(3) git commit to the local branch
git reset <Options> HEAD-1 (HEAD ^) returns to the last submitted version
Options:
--mixed (the default parameters, and do not write the same effect) does not delete a workspace change the code, the revocation of commit, and the revocation git add. Operation
--soft not delete a workspace change the code, revocation commit, not revoked git add.
--head delete a workspace change the code, revocation commit, undo git add. (That is restored to the last commit state)