Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 to do so in Atlassian SourceTree (for Windows)?

like image 768
Ludwig Avatar asked May 27 '15 12:05

Ludwig


People also ask

How do I compare two commits in Sourcetree?

After you set it as an external diff tool in sourcetree, you select both files you want to compare using CTRL and after that you press CTRL+D. As a result, Beyond Compare will be launched with both files ready to be compared.

How do I see all changes in Sourcetree?

Just CTRL+Click the tip of each branch in the Log and it should show you all the changes between those 2 commits.

What is the git command to view all the changes since last commit?

By default git diff will show you any uncommitted changes since the last commit.

How do I view file history in Sourcetree?

Users can navigate to the log/history window by clicking the tick-shaped icon button at the top-left section. Users can also alternatively press Command+1, or navigate it through View > File Status View.


1 Answers

Try this:

git archive --output=test_zip.zip HEAD $(git diff --diff-filter=ACMRTUXB --name-only hash1 hash2)

Just replace the hash 1 and hash 2 in the example with the desired commits hash and name the zip file where you want your change to be zipped.

It works for me

like image 117
Martin Tonev Avatar answered Sep 21 '22 19:09

Martin Tonev