views:

43

answers:

1

I want to be able to do this for a script. I'm essentially re-creating the entire version history of some code in git - it currently uses a different version control system. I need the script to be able to add in the commits to git while preserving the commit's original author (and date). Assuming I know the commit author and the date/time the change was made, is there a git command that allows me to do this? I'm assuming there is, because git-p4 does something similar. I'm just asking for the best way to do it.

+3  A: 

Check out the --author option for git commit:

From the man page:

--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.

Tim Henigan
Also, the `--date` option to override the date.
Chris Johnsen
Excellent! Thank you.
carleeto