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

前端 未结 5 664
情歌与酒
情歌与酒 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:36

    Here's a solution using 7zip with a Custom Action (Tools > Options > Custom Actions > Add):

    Menu caption: > dist.zip
    
    [ ] Open in a separate window
    [ ] Show Full Output
    [X] Run command silently
    
    Script to run: X:\Your\path\to\7-Zip\7z.exe
    
    Parameters: a $REPO\dist.zip $FILE
    
    (Restart SourceTree after creation for the changes to take effect!)
    

    This action works from the context menu for Unstaged Files and changed files in commits from the Log / History (even with multiple files / multiple commits selected) and will add those files to a "dist.zip" in the repo root. Just note that the file will not be deleted before adding files, so if you want to start from scratch, remember to delete the zip file first.

    This has made it so much easier to update live systems with just the files that have changed, in projects where there's no build system involved. I wonder how I was able to live and work for so long without it. :-)

提交回复
热议问题