How do I list just the files that would be committed?

后端 未结 4 1415
闹比i
闹比i 2021-02-01 15:33

Is there any way to get a list of files that will be committed when I type the following?

git commit -m \"my changes\"

git status lists too muc

4条回答
  •  我在风中等你
    2021-02-01 15:41

    This command will tell you what files in your index/cache/staging area differ from the current HEAD (and whether they are additions, modifications or deletions) which is the changes which will be committed if you use git commit without explicit paths or the -a option. It's format is reasonably similar to the svn status output which you show.

    git diff --cached --name-status
    

提交回复
热议问题