- 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.
- Redis使用手冊
- Microsoft SQL Server企業(yè)級平臺管理實踐
- 數(shù)據(jù)之巔:數(shù)據(jù)的本質(zhì)與未來
- 云計算環(huán)境下的信息資源集成與服務(wù)
- MongoDB管理與開發(fā)精要
- R數(shù)據(jù)科學(xué)實戰(zhàn):工具詳解與案例分析(鮮讀版)
- 揭秘云計算與大數(shù)據(jù)
- Mastering Machine Learning with R(Second Edition)
- 大數(shù)據(jù)時代下的智能轉(zhuǎn)型進(jìn)程精選(套裝共10冊)
- Python醫(yī)學(xué)數(shù)據(jù)分析入門
- 企業(yè)級數(shù)據(jù)與AI項目成功之道
- PostgreSQL指南:內(nèi)幕探索
- 重復(fù)數(shù)據(jù)刪除技術(shù):面向大數(shù)據(jù)管理的縮減技術(shù)
- 大數(shù)據(jù)數(shù)學(xué)基礎(chǔ)(Python語言描述)
- 云計算寶典:技術(shù)與實踐