What's going on when git commit reports "Changes not staged for commit:"?
巴扎黑
巴扎黑 2017-05-02 09:29:34
0
7
3228

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

巴扎黑
巴扎黑

reply all(7)
给我你的怀抱

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 多次。不想addCan:

git commit -m 'msg' <file>

or

git commit -m 'msg' -a
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template