本文介绍了如何压缩所有提交而不丢失子模块?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我喜欢。
但是,如果我发现合并冲突:
code> git commit --amend
第一个命令将当前分支重置为第一次提交,但保留当前索引和第二个命令提交上次提交中的当前索引。
I like the answers from How to squash all git commits into one?.
However, I get merge conflicts if I:
git rebase --root -iwith pick and squash as suggested.
And, I lose my submodules (I have 5), when I
rm -rf .git git init git add .What is the most effective way to squash all history and keep my submodules in their current directories at their current sha.
解决方案Try git reset --soft SHAOFFIRSTCOMMIT and then git commit --amend
The first command resets the current branch to the first commit, but keepsmthe current index and the second command commits the current index in the last commit.
这篇关于如何压缩所有提交而不丢失子模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!