Answer the question
In order to leave comments, you need to log in
How to work with git history in a team?
There are teams. There is a command github. There is a ready pull request in the mainline. But some commits do not match the command agreement.
That is, deep in history there are several commits that:
Answer the question
In order to leave comments, you need to log in
Moment number 1.
The hashcode of the commit is calculated taking into account the text of the commit and the details of the author and the hashcode of the previous one. Hence the conclusion that they cannot be changed without changing the entire commit tree of the pull request.
There is only one way out - to rebase your branch with all the consequences and resubmit.
If you merged from mainline to your branch and all of them passed without conflicts, then your task will be solved
(just don't reorder commits - see BUGS ).
If there were conflicts, and indeed it is more correct to do git filter-branch, for example:
git filter-branch --env-filter 'export GIT_AUTHOR_NAME="New Author Name"' --msg-filter 'if [ "$GIT_COMMIT" = "339167af5c274dedd5efcf93f83f4bfc4acb9eba" ]; then echo "new commit message"; else cat; fi' -- mainline_branch_name..your_branch_name
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question