M
M
Marat2011-08-29 07:35:18
git
Marat, 2011-08-29 07:35:18

How to get a cumulative patch in GIT

Is it possible in GIT to get in an archive (or just in a folder) all the files that have changed since a certain revision, in the same file structure as in the repository?
Those to get a patch for those who do not have GIT, and so that they can simply unpack this archive.
I tried to deal with "git format-patch", but it only outputs in its format.
There is also "git archive -o update.zip" - but it gives out all 5000 files.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Marat, 2011-08-29
@Xakki

The solution is
git diff --name-status commit1 commit2 | awk '{ if ($1 != "D") print $2 }' | xargs git archive -o output.zip HEAD
where commit1 commit2, indicate between which commits changes are needed, or specify the hashcode of one commit starting from which and before HEAD there will be changed files in the archive.
git diff --name-status - gives a list of files that have been changed, and git archive - drives this matter into an archive. What awk '{ if ($1 != "D") print $2 }' does is something I still don't understand.
Thanks to Chaitanya Gupta from stackoverflow.com for the practical instant response.

S
skitales, 2011-08-29
@skitales

git format patch.
Here are the links where the function arguments are described: [1] , [2] .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question