Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork939
Closed
Milestone
Description
I can't seem to find out how to make commit with specifyingauthor_date
andcommit_date
, but it did not really work:
import git...repo = git.Repo.init(repo_path)repo.index.add(['some_file'])repo.index.commit(message, authored_date=commit_date, committed_date=commit_date)
throws:
TypeError: commit() got an unexpected keyword argument 'authored_date'
Then I looked at thesource and found out it does not really have parameters for commit datetime. (or am I missing something? Would you be interested in a PR which adds these parameters? I am interested to learn and make contribution 😄 )
So, I either I have to create a commit then change dates (usingCommit
object) or usegit directly.
or set OS envs before commit call:
...os.environ['GIT_AUTHOR_DATE'] = date_in_isoos.environ['GIT_COMMITTER_DATE'] = date_in_isorepo.index.commit(message)