(2) Workspace: In a project directory, except. Git files are workspaces.
(3) Staging area: Staging area can be understood as the cache between file modification and final submission to git version library. In order to prevent unnecessary files from being submitted at one time and there is room for rollback, there is a staging area.
(4) Header: The header is in the file. Git folder. The content of the file is a 32-bit 16 hexadecimal number, just a pointer. This submission point is actually a submission object, which contains many attributes, including the directory structure index of the last submission point, the id of the last submission point, the submitter and the submission time.
(1) First of all, according to my thinking, let's create a git warehouse and understand the git add command through an example.
1. First, we create a warehouse through git init, and then we generate a. git folder, which is a git warehouse.
2. Create a A.java file.
Execute Gideon A.java.
Object file in. Git, I found an extra folder. Open it, there is a file with a string of symbols in it. Open this file, which contains a string of unrecognized characters.
What did git add do?
Actually, when executing the git add command, git will first calculate the sha- 1 corresponding to the file name A.java with the value of1fed2a34f13d2a34f13d, and this code is a 32-bit 16 hexadecimal number. Git will use the first two digits of this code as the folder name in the. Git/objects folder, with the last 30 bits of the code as the file name, in. Git will compress the contents of A.java's files to some extent.
to be continued .....
This article ends here. There may be some places in the article that are not clearly explained. Please specify the content of the discussion. If in doubt, please feel free to harass. Please reply as soon as you see it!