Create a patch from a commit

5

When you run the command git apply you can create a commit with changes from a text file:

git apply ~/Downloads/patch.txt

How do I create this patch file from an existing commit ?

    
asked by anonymous 13.06.2017 / 22:09

1 answer

3

As mentioned in the comments of the question, just use the command git format-patch according to the git manual, it can be used in several ways, but I believe the main ones are:

git format-patch <commitish_inicial>

or

git format-patch <commitish_inicial>..<commitish_final>

So git generates one or more files in 0000-algo-como-a-msg-de-commit.patch format that can be applied with git apply .

    
04.07.2017 / 00:47