怎样将N次提交压缩成一次提交?
发布时间:2022-09-01 15:14:00
发布人:qyf

两种方式:
●如果要从头开始编写新的提交消息,请使用以下命令:
git reset --soft HEAD~N && git commit
●如果你想在新的提交消息中串联现有的提交消息,那么需要提取这些消息并将它们传给 git commit,可以这样:
git reset –soft HEAD~N &&
git commit –edit -m "$(git log –format=%B –reverse .HEAD@{N})"