- Git Essentials(Second Edition)
- Ferdinando Santacroce
- 305字
- 2021-07-02 15:27:04
Adding a file
Let's create a text file, just to give it a try:

And now what? Is that all? No! We have to tell Git to put this file in your repository, explicitly. Git doesn't do anything that you don't want it to do. If you have some spare or temp files in your repository, Git will not take care of them, but will only remind you that there are some files in your repository that are not under version control (in the next chapter, we will see how to instruct Git to ignore them when necessary).
Okay, back to the topic. I want file.txt under the control of Git, so let's add it, as shown here:

The git add command tells Git that we want it to take care of that file and check it for future modifications.
In response to this command, it could happen that you will see this response message from Git:
warning: LF will be replaced by CRLF in file.txt.
The file will have its original line endings in your working directory.
This is because of the option that we selected when installing Git: Checkout Windows-style, commit Unix-style line endings. Don't worry about it for the moment; we will deal with it later.
Now, let us see if Git obeyed us.
Using the git status command, we can check the status of the repository, as shown in this screenshot:

As we can see, Git has accomplished its work as expected. In this image, we can read words such as branch, master, commit, and unstage. We will look at them briefly, but for the moment, let's ignore them: The purpose of this first experiment is overcome our fear and start playing with Git commands; after all, we have an entire book in which to learn the significant details.
- 數(shù)據(jù)產(chǎn)品經(jīng)理高效學(xué)習(xí)手冊(cè):產(chǎn)品設(shè)計(jì)、技術(shù)常識(shí)與機(jī)器學(xué)習(xí)
- Mastering Ninject for Dependency Injection
- Access 2007數(shù)據(jù)庫(kù)應(yīng)用上機(jī)指導(dǎo)與練習(xí)
- 分布式數(shù)據(jù)庫(kù)系統(tǒng):大數(shù)據(jù)時(shí)代新型數(shù)據(jù)庫(kù)技術(shù)(第3版)
- Libgdx Cross/platform Game Development Cookbook
- Live Longer with AI
- 數(shù)據(jù)庫(kù)應(yīng)用基礎(chǔ)教程(Visual FoxPro 9.0)
- 大數(shù)據(jù)時(shí)代下的智能轉(zhuǎn)型進(jìn)程精選(套裝共10冊(cè))
- 大話Oracle Grid:云時(shí)代的RAC
- INSTANT Android Fragmentation Management How-to
- Augmented Reality using Appcelerator Titanium Starter
- 數(shù)據(jù)庫(kù)技術(shù)及應(yīng)用
- 數(shù)據(jù)庫(kù)應(yīng)用系統(tǒng)技術(shù)
- Hands-On Deep Learning for Games
- 企業(yè)級(jí)大數(shù)據(jù)項(xiàng)目實(shí)戰(zhàn):用戶(hù)搜索行為分析系統(tǒng)從0到1