简体   繁体   中英

How to apply a serie of patches with git

It is convenient to send sets of patches using git send-email . But once I received a set of patch, how to apply them? Especially, how to apply them in right order?

If I save them in a separate Maildir and I give this Maildir in argument to git am , patches are not applied in right order.

Currently, I specify each file separately on git am command line, but it's tedious.

One of solutions would be:

git am $(perl -e  'my @r = sort { `grep Subject: $a` cmp `grep Subject: $b` } @ARGV; print "@r"' Maildir/new/*)

I strongly dislikes this hack. Is anyone has a better idea?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM