git merge with --no-ff and --squash

自作多情 提交于 2019-12-03 13:26:38

I tried combining --squash and --no-ff together and got:

fatal: You cannot combine --squash with --no-ff.

A git merge basically is a squash. After resolving conflicts, it will appear as one commit on develop. The diff of the merge revision is the result of conflict resolution. And yes the changes on mybranch are preserved. Just do "gitk mybranch &" after the merge to verify.

Besides The Shadow is correct. Do not be afraid. Create a new branch, play around and see what the results are.

The damage was done in your "git pull --rebase origin develop" command.

Answer (assumes you have local develop branch based on origin/develop):

git checkout develop
git pull
git merge --no-ff mybranch
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!