Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Editing a commit's metadata #1143

Answered by Byron
lenormf asked this question in Q&A
Discussion options

Hi!

Is it possible to edit a commit's metadata (author, committer etc) using only a Commmit object?

I see that we can get a list of commit instances that reflect the history of a target branch, but could I change the attributes of those instances (e.g. the author attribute) and have the changes be applied to the repository (on the fly, or using some kind of repo.commit() function)?

Thanks!

You must be logged in to vote

The git commit history is immutable and thus append-only. Adjusting anything requires rewriting parts of the history.

This can be done easiest using git rebase -i or git-filter-branch. Equivalent functionality could be implemented in GitPython, but it's certainly very close to the 'metal'.

Even though this issue is closed, please feel free to add further comments or remarks.

Replies: 1 comment

Comment options

The git commit history is immutable and thus append-only. Adjusting anything requires rewriting parts of the history.

This can be done easiest using git rebase -i or git-filter-branch. Equivalent functionality could be implemented in GitPython, but it's certainly very close to the 'metal'.

Even though this issue is closed, please feel free to add further comments or remarks.

You must be logged in to vote
0 replies
Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #972 on February 26, 2021 11:18.

AltStyle によって変換されたページ (->オリジナル) /