Git archive of repository with uncommitted changes

前端 未结 9 853
旧时难觅i
旧时难觅i 2021-02-01 18:31

How can I create an archive of the current repository including local uncommitted changes using git archive?

9条回答
  •  無奈伤痛
    2021-02-01 19:11

    git ls-files is preferred cause it doesn't need to create any commit object.

    git ls-files --recurse-submodules -z | tar --null -T - -czvf output.tar.gz
    # git ls-files
    #   --recurse-submocules
    #   -z, split output lines with null
    # tar
    #  -T -, read files from stdin
    

提交回复
热议问题