View git history
Git log [branch]/[commit hash]/[tag]Displays a summary of Historical submission information for a branch, commit, or tag.
Git log a .. BDisplay historical information in a-B Evolution
Add the parameter-P to view the detailed modification information.
Git show [branch]/[commit hash]/[tag]Display details of the last submission
The variable head indicates the Branch currently being processed. If it is a multi-channel merge head ^ n tableThe Nth ancestor, head ~ N indicates the ancestor of the N generation
Git grep "keyword" [branch]/[commit hash]/[tag]Filter and find the corresponding keywords. Various options of grep are supported.
Git Object Database
Git uses four types of objects to manage the system
Git cat-file can be used to view corresponding files,-T is used to list object types, and-P is used to print objects
You can use git show to obtain the 160-bit hash value, which indicates a commit object.
- The commit object will point to a tree object, that is, the image of the tree directory of the current node in the history; it will also point to the parent commit to establish an association with the previous commit.
- The tree object is used to display the status of a directory. The tree object contains blob objects and subdirectory objects.
- Blob objects contain file data.
- The head of each branch is stored in. Git/refs/heads. At the same time, the headers of the current branch are stored in. Git/head.
Git index file
For the role of the index file, see the other two documents. for reference:
Located in./git/index. You can use the command git LS-files -- stage to view the hash list. Use Git-catfile to view the hash list and get the latest modification.
Therefore, the role of git add is to create a blob file to record the latest changes.CodeAnd add a link to this blob in index file.