1

I have applied a patch using

git apply someone-else.patch

tested that it works ok and it does so next, I want to push that change to master.

The problem is I want to do that without re-authoring a commit for it (i.e. since the patch is not my work, but someone else's, I am keen they keep the authorship credit on the git log).

At the moment the applied patch is not showing up on my gitlog so I am assuming there is another step but I have no recollection of what that step is from having done this quite a while ago in the past and not needed to repeat it again very often. Google is not being forthcoming here, so my guess is I am forgetting the name of the appropriate command.

To summarise, what can I do next to get this patch pushed without making a fresh commit?

Magpie
  • 607
  • 2
  • 7
  • 26

2 Answers2

3

To summarise, what can I do next to get this patch pushed without making a fresh commit?

Well, you have to make a fresh commit.
But at least, you can make said commit with the right author name:

git commit --author="xxx <xxx@email.com>" -m "patch from xxx"

(see an example at "git commit as different user without email / or only email")

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
2

I ended up following the instructions found on this blog but added one step to make the procedure work properly

The procedure:

  1. git apply someone-else.patch

  2. Test it works

  3. git add changed-files

  4. git am --signoff < someone-else.patch

  5. git push

Magpie
  • 607
  • 2
  • 7
  • 26