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

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

    From within sourcetree:

    • Choose the first commit to start from
    • Hold the shift key
    • Click on the last commit you want to export
    • Right click with the mouse: and choose create patch
    • Set the name of the file to save and you patch is ready

    enter image description here


    Using CLI:

    Open terminal (Icon on the sourcetree icon bar)

    Then type:

    git diff ..HEAD > my_all_commits.diff
    

    It will generate a diff file with all the changes in the given range.


    How to generate single patch per commit

    git format-patch SHA-1..SHA-1.
    This commit will create set of patches per commit with all the changes in the commit. You can then choose to use them all or only to pick those you want to apply tot he second repo.

    Good Luck.

提交回复
热议问题