The previous article introduced a good tool to learn Git, if you have not read it, please read it first:
54 Off, light up your Git skills tree
Today I will take everyone to finish the top ten. The first level in the previous article has been completed, we start from the second close.
If you have questions about any of the commands, please see the recommended tutorials in the first article.
Second Pass
According to the prompt, we want to configure "user name" and "Mailbox", why?
After your code is submitted, especially submitted to the open source community, be seen by others, people think this code is written by the real cow, want to give you a job opportunity, how to contact you?
Usually, we create a new file in the IDE, and the IDE automatically adds information such as date, author, mailbox, and so on. In fact, I think this is outdated tradition, and now we like to try to keep the source code clean.
Like create log, author, mailbox This information should be given to the version control system to record.
Of course, if you write a bad code, you should be careful, others git blame can greet your family.
Specific how the clearance process is as follows:
Third off
Four-off
Five-off
Six off
Seventh Pass
This can be a bit of a hassle for students who don't know about Vim. Here is also a very close to the actual scene, using Vim to edit the file, will produce a .swp file, the role of this file is: After you accidentally quit Vim or vim itself crashes, edit this file again, you will be prompted to have a .swp file, ask whether to recover.
It belongs to a temporary file and should obviously not be submitted to the VCS. So Git has a mechanism that allows us to ignore certain files.
Eighth Pass
Follow the prompts to see Help git gitignore--help , input /negate to search, navigate to the following paragraph:
According to the help we know, can be used ! to reverse the pattern.
So we edit .gitignore , append the following two lines:
*.a!lib.a
Successful clearance!
Nineth Pass
git statusis a very common command, insert a digression: I give it a nickname, so it is gst very convenient to knock.
Tenth Pass
Both of these are the basic concepts of examining a file of several states:
- untracked-New file, Git doesn't even know it exists
- Not staged-files that have been indexed and modified
- Staged-
git add documents that are about to be submitted after adoption
Here is a look at the state, if executed now git commit , only the top two files will be a commit.
Come here today, if you have any questions welcome to "here" to discuss with me!
?
54 Off, light up your Git skills tree (a)