How to export all changed files between two Git commits in SourceTree?

前端 未结 5 669
情歌与酒
情歌与酒 2021-02-02 00:03

In TortoiseGit and TortoiseSVN it is possible to export all changed files between two revisions, including the directory structure, to an external folder.

Is there a way

5条回答
  •  南笙
    南笙 (楼主)
    2021-02-02 00:43

    I did this code for custom action on windwos .bat

    single commit (Search on google) [question]:Create archive of modified files in GIT via batch file

    setlocal enabledelayedexpansion
    set output=
    for /f %%G in ('git diff-tree --no-commit-id --name-only -r %1^^') do ( set output=!output! "%%G" )
    git archive -o update.zip %1 %output%
    endlocal
    

    Between to commits (Variation of the top one)

    setlocal enabledelayedexpansion
    set output=
    for /f %%G in ('git diff-tree --no-commit-id --name-only -r %2^^ %1') do ( set output=!output! "%%G" )
    git archive -o update.zip %1 %output%
    endlocal
    

    You have to set by parameter the $SHA

提交回复
热议问题