3 ms·
No, it is not a misconception. How do I apply a patch from gmail to a specific git repo on my computer? (I would genuinely like to know the answer, but it must
by da39a3ee 3y ago
No, it is not a misconception. How do I apply a patch from gmail to a specific git repo on my computer? (I would genuinely like to know the answer, but it must not involve mutt, gnus, or dovecot!)
- JohnKemeny 3y agoCopy the content of the email to your clipboard, type `git am` in your terminal, paste and C-d to complete.
- da39a3ee 3y agoOK thanks, that sounds fairly convenient for small patches. And I expect you'd say download the email for larger patches (as a sibling commenter suggests).
- sammorrowdrums 3y agoIn the worst case you can copy paste a patch into a new local file in the repo and then apply it with git from there. I’ve had somebody slack me patches before and it is not a big lift.
- u801e 3y agoSave the email to your local machine (in gmail, click the 3 dots and choose download message). Then run git am < saved_email_file.eml
- da39a3ee 3y agoRight, thanks! (And using clipboard and stdin sounds even more convenient for small patches as a sibling comment suggests.)
- u801e 3y agoCopy-paste may not work depending on how the email client renders the email. For example, if the email client doesn't preserve prefixed whitespace, then the resulting patch may be corrupted or not apply. Saving the actual email to a file on disk would avoid that issue.
- ori_b 3y agoMany local mail clients also just let you pipe the message into a command; for example, in mutt, you could just type: |git am once you have the message open.
- jen20 3y agoYou may have a skewed idea of “most” here. Most people are using gmail, but when it comes to local clients, Outlook, Apple Mail and Thunderbird are by far the most common and as far as I know none of them support this without extra steps.