Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to apply a patch using git without configuration

I have written some instructions that also use git to apply some patches. The instructions are intended to be put into the console and be done with it. Like this:

git am bar.patch
git am foo.patch

But git is now asking for the users name/email:

*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'root@user-VirtualBox.(none)')
You need to set your committer info first

This does not seem to be needed, as only the author of the the patches appear in the git log, but not the one who applied them. Is there a way to ignore configuration?

edit: typos

like image 630
mwarning Avatar asked Nov 09 '22 23:11

mwarning


1 Answers

See "Difference between author and committer in Git?"

When you apply a patch, you are the committer. So Git needs to know who "you" are.

Regarding git am, I would recommend considering to use the --committer-date-is-author-date if you want the date associated with those commits created by those patch to be the same as the date recorded in said patches.

like image 93
VonC Avatar answered Nov 15 '22 04:11

VonC