Git interactive rebase rewrite commit

git edit rebase git-commit

39 просмотра

1 ответ

I want to edit a commit with interactive rebase. When I replace pick with edit, the changes of this commit are still applied on the repo (so that I can edit the commit) but I want to rewrite it from scratch. How can I do that?

Автор: stonar96 Источник Размещён: 29.09.2019 08:01

Ответы (1)

2 плюса


Once you are editing the commit during your interactive rebase, you should be able to checkout its state to the parent commit (meaning the working tree will reflect the state before the changes of the commits are applied)

 cd /path/to/repo/root/folder
 git checkout @~ -- .

 # make additional changes
 git commit -m "rewrite commit"

 git rebase --continue
Автор: VonC Размещён: 25.08.2017 05:16
Вопросы из категории :