In Tortoisegit you can select multiple commits at the head of a branch and replace them with a single commit. (Show the log, select the commits, and right click). When this happens, you are given the opportunity to write a new commit message.

What is the command line equivalent to do this?

有帮助吗?

解决方案

Do an interactive rebase.

git rebase -i master

will rebase your current branch on master and let you edit/remove/rearrange commits and edit commit messages. You can also arbitrarily select which branch or range of commits to rebase and onto which branch.

Interactive rebase help on GitHub

Git rebase docs

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top