Jay Taylor's notes
back to listing indexGenerate a git patch for a specific commit
[web search]
I need to write a script that create patches for a list of SHA1 commit numbers. I tried using Is there a way to generate a patch only for the specific SHA1? |
||||
Try:
|
|||||||||||||||||||||||||||||||||
|
For generating the patches from the topmost commits from a specific sha1 hash:
The last 10 patches from head in a single patch file:
|
|||
Say you have commit id 2 after commit 1 you would be able to run:
where 2 and 1 are SHA hashes. |
|||||||||||||||||||||
|
This command (as suggested already by @Naftuli Tzvi Kay):
Replace will generate the patch file for the latest commit formatted to resemble UNIX mailbox format.
Then you can re-apply the patch file in a mailbox format by:
See: |
||||
If you want to be sure the (single commit) patch will be applied on top of a specific commit, you can use the new git 2.9 (June 2016) option
See commit bb52995, commit 3de6651, commit fa2ab86, commit ded2c09 (26 Apr 2016) by Xiaolong Ye (``).
|
|||
To generate path from a specific commit (not the last commit):
|
|||
Your Answer
Not the answer you're looking for? Browse other questions tagged git or ask your own question.
asked |
5 years ago |
viewed |
245092 times |
active |
Linked
Related
Hot Network Questions
- How to close broken bus line?
- Why don't you connect unused hot and neutral wires to "complete the circuit"?
- Should low frequency players anticipate in orchestra?
- Opening a portrait in LATEX
- Is the NHS wrong about passwords?
- Standard way for novice to prevent small round plug from rolling away while soldering wires to it
- Why the outputs of `sort`, `sort k 1`, `sort k 1,1` are equal?
- Double GPIO Adapter
- Should I serve jury duty when I have no respect for the judge?
- How do computers calculate sin values?
- The commuter's journey
- Is it possible to elementarily parametrize a circle without using trigonometric functions?
- Is there any difference between friendly and kind?
- Is it worth buying real estate just to safely invest money?
- What are the benefits of reciting Durga Saptashati Devi Aparadha Kshamapana Stotram?
- Traditional notation option?
- How to defend Earth against "alien bees tactic" in the modern era?
- Numerical coincidence? Why is sum(x^(k^2)) = sum(x^((k+1/2)^2)) for x = 0.8?
- What is this red X icon showing in Thunderbird?
- If you are a U.S. citizen, are you required to have a return ticket (round trip ticket) to travel to Ghana?
- Why are Exp[3] and 2 treated differently within Complex?
- How can I reduce my code when I used \addplot [black, mark = *] coordinates many times?
- How to cope with too slow Wi-Fi at hotel?
- Removing code smells from day of year calculation method
Technology | Life / Arts | Culture / Recreation | Science | Other | ||||||
---|---|---|---|---|---|---|---|---|---|---|