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

后端 未结 4 1358
闹比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:46

    This is what I was looking for. Thanks to notnoop for the lead I needed. I wanted to post back my solution in case it helps others.

    git diff HEAD  --name-only
    

    Since I intended to do

    git commit -s -F mesage.txt
    

    with the files found in the first line.

    My intent is to create a little system that totally ignores the index i.e. that I never need to do git add. (From what I understand, the index is useful when creating patches, which isn't by no means the norm in my workflow.)

提交回复
热议问题