Sending patches

In the previous example, you saw how to create and apply patches. You can, of course, attach these patch files directly to an e-mail, but Git provides a way to send the patches directly as e-mails with the git send-email command. The command requires some setting up, but how you do that is heavily dependent on your general mail and SMTP configuration. A general guide can be found in the Git help pages or visit http://git-scm.com/docs/git-send-email.

Getting ready

We'll set up the same repository as in the previous example:

$ git clone https://github.com/dvaske/offline-sharing.git
Cloning into 'offline-sharing'...
remote: Counting objects: 32, done.
remote: Compressing objects: 100% (25/25), done.
remote: Total 32 (delta 7), reused ...

Get Git: Mastering Version Control now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.