1 git log command to view commit log information
git log--pretty-fuller #详细查看
git log--stat #查看每次提交的文件变更
git log--pretty-online
2git diff vs. File modification information
git diff HEAD git Add. Comparison with the head pointer of the current repository
git diff--cached or--staged commit file differences in staging area and repository
How Git commands affect workspaces and staging area
The left side is the repository for the right side of the workspace. Staging area, marked as index in the repository, is the directory tree represented by the master branch
Head is the head that appears in a cursor graph pointing to the master branch can be replaced with master
The object library objects as Git in the figure is actually located in the. Git/objects Directory
When you execute the git add command on a workspace modification (or new) file, the staging area directory tree is updated and the contents of the workspace modified (or added) are written to a new object in the object library and the ID of the object is recorded in the staging area index file
When a commit commit is committed, the staging area tree writes that the master branch in the current repository (object library) will update, that is, the directory tree to which master is most recent is the directory tree at the time of submission staging area
When executing git reset head, the staging area tree will be rewritten and replaced by the directory tree pointed to by Maste, but the workspace will not change.
When you execute git rm--cached (filename), the file is deleted directly from staging area but the workspace is unchanged
When executing git checkout. Or the Git checkout-(file) command will replace all or specified files in the workspace with all staging area files or specified files. This action clears changes that have not been added to the staging area in the workspace
When executing git checkout HEAD. Or the Git checkout head (file) command replaces the files in the staging area and workspace with all or the specified files in the master branch that the head points to. Also clear uncommitted changes in workspace and temporary access
Full learning git two git staging area