After modifying the code and submitting it via git commit, the log reported is as follows
deMacBook-Pro:cheatsheetcup yoo$ git commit -m"modified Cheatsheet.html"
On branch master
Changes not staged for commit:
modified: Python Cheatsheet.html
Untracked files:
.DS_Store
.idea/
no changes added to commit
Whether the content in the file Python Cheatsheet.html has been committed successfully
Have you git add
git commit -am "modified Cheatsheet.html"
-a 表示 add
Before executing commit, choose git add Cheatsheet.html or git add .
Then git commit -m "modified Cheatsheet.html"
Git is divided into workspace and repository. The workspace is your code, and the repository is the git record.
Before modifications enter the repository, there is a temporary storage area also called an index, which is the area recorded after the git add operation. When committing, the records in the staging area are added to the version database. Your prompt says that staged has no content, which means you have not performed an add operation.
See here for details http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/0013745374151782eb658c5a5ca454eaa451661275886c6000
Use .gitignore to block the Untracked files that you don’t want to display. It won’t be good if they appear every time
No git add
git
这里有点特殊。要先加入到 staging area 的改动才会被git commit
提交。同一个文件也可以add
多次。不想add
Can:or