tags:

views:

74

answers:

2

I've done a manual cherry pick of a commit from one project into my git project, and I'd like to give credit to the true author by faking the author info somehow for this one commit, so that the true author is the author, and I am the committer.

Any idea how to do this?

+3  A: 

You can specify the author as parameter to git commit:

git commit --author='Erik Vold <[email protected]>' ....
Andomar
+3  A: 

There are several ways. If the environment variables GIT_AUTHOR_NAME and GIT_AUTHOR_EMAIL are set, Git will use those. Also, you can pass the --author argument to git commit as per the documentation:

--author=<author>
Override the commit author. Specify an explicit author using the standard A U Thor <[email protected]> format. Otherwise <author> is assumed to be a pattern and is used to search for an existing commit by that author (i.e. rev-list --all -i --author=<author>); the commit author is then copied from the first such commit found.

However, you don't actually need to do anything because git cherry-pick already does that automatically.

Jörg W Mittag