Harvey Harvey - 1 year ago 74
Git Question

How do I change the From: address used for git format-patch?

I'm generating some patches for an opensource project and my From: line is always me@domain.com. I've been manually editing the From: line to be me-emaillist@domain.com before running git send-email.

  1. Is there anyway to automatically do this?

  2. Should I be doing this at all? I'm already using the envelope sender config.

  3. Will the author line in the upstream repo be "me-emaillist@domain.com" because I changed the From address?


From fab0cf45f10686688a8138f60a09505200cbb2a4 Mon Sep 17 00:00:00 2001
From: John Doe <me-emaillist@domain.com>
Date: Mon, 25 Feb 2013 23:06:23 -0500
Subject: [PATCH] nand: adjust erase/read/write partition/chip size for bad blocks

After considering mvp's answer, my explicit answers are:

  1. No, because...

  2. No, because...

  3. Yes, the From: line is taken from the Author of the commit because
    git am
    uses the From: line when setting the name of the author in the upstream repository.

mvp mvp
Answer Source

Setting your git identity should be enough:

git config --global user.email me@domain.com
git config --global user.name "John Doe"

You can also set your identity per git repository: run these commands inside that git repostory and simply omit --global flag.

You probably should not use me-emaillist@domain.com because if someone git am it, this commit will have not your identity.

Probably the only reason to do that is to avoid spam to your primary address - but I think you will get it anyway as soon as it becomes public.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download