Réduire
Brouillon
0
19/08/2020
0

How to rename old pushed commits in Git

Mots-clés:
Git

In the branch containing the commits to rename (3 is to go back to third commit):

  • git rebase -i HEAD~3
  • replace pick by reword for the lines that will have to be renamed (without changing the message yet) and save the file
  • edit the message each time it is requested (for the commits for which pick was replaced by reword)
  • git push origin branch_name -f