Merge two commits into one and push to remote repo
This question already has an answer here:
If you have ONLY 2 commit, they can't be merged in common way, because git rebase -i
then squash need a commit before these 2 commit, which doesn't exists.
So, as you can see on github or other public git repostory, the common way of the first commit is an alomost empty commit, with a empty .gitignore file. This will avoid situation you meet now.
If you really need to merge these 2 commit, here is my answer:
git format-patch -2
git init
git apply 0001*
git apply 0002*
上一篇: 限制Q在Node js中承诺并发
下一篇: 将两个提交合并为一个,并推送到远程回购