为什么我不知道我的文件已被更改?

时间:2016-07-26 00:58:19

标签: git git-commit

这里我做了什么:

我提交了一些文件。 之后我得到了这个状态

$ git status
warning: LF will be replaced by CRLF in topGamesMenu.php.
The file will have its original line endings in your working directory.
# On branch TopGamesMenu
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       modified:   index.php
#       modified:   nbproject/private/private.xml
#       new file:   topGamesMenu.php
#

然后我想推

git push -m 'logos vom den besten spielen im menu implementiert'

但我意识到按摩参数应该在提交时不在push命令。 如此承诺

$ git commit -m 'logo von dem vier besten spielem um menu implementiert'
[TopGamesMenu warning: LF will be replaced by CRLF in topGamesMenu.php.
The file will have its original line endings in your working directory.
8fa4dea] logo von dem vier besten spielem um menu implementiert
warning: LF will be replaced by CRLF in topGamesMenu.php.
The file will have its original line endings in your working directory.
3 files changed, 133 insertions(+), 86 deletions(-)
create mode 100644 topGamesMenu.php

在此命令之后,我的git状态不再显示更改。

$ git status
# On branch TopGamesMenu
nothing to commit, working directory clean

--- --- EDIT

git push不起作用。 git说

Everything up-to-date

出了什么问题?

1 个答案:

答案 0 :(得分:1)

无论你看到什么都是预期的!

提交后,

Git不会在git status中列出您修改过的文件。事实上,如果您已设置上游,它应该像

Your branch is ahead of 'origin/<your branch>' by 1 commit. 

如果要查看修改后的文件,请使用

git log --name-only