Using Git to create an archive of changed files

后端 未结 3 585
醉梦人生
醉梦人生 2020-12-25 08:22

I am looking for a simple solution to make a archive of recent changed file.

I get this simple command from google

git archive -o update.zip HEAD $(g         


        
3条回答
  •  无人及你
    2020-12-25 08:58

    You just need to filter out files deleted while that diff to fix that error:

    git archive -o update.zip HEAD $(git diff --name-only --diff-filter=d HEAD^..HEAD)
    

    May be git archive is overhead for that task and you should use @eckes's answer.
    But, you still should add --diff-filter=d to exclude removed files from archive.

提交回复
热议问题