Git diff --name-only and copy that list

后端 未结 7 763
眼角桃花
眼角桃花 2021-01-29 18:55

I just want to get a list of changed files between two revisions, which is simple:

git diff -–name-only commit1 commit2 > /path/to/my/file

B

7条回答
  •  旧时难觅i
    2021-01-29 19:31

    Here's a one-liner:

    List changed files & pack them as *.zip:

    git diff --name-only | zip patched.zip -@
    

    List last committed changed files & pack them as *.zip:

    git diff --name-only HEAD~ HEAD | zip patched.zip -@
    

提交回复
热议问题