git diff to see what a merge would introduce

时光总嘲笑我的痴心妄想 提交于 2019-12-03 16:17:27

There are other ways to visualize what would happen, but I find the easiest is git merge --no-commit. From the man page:

--commit, --no-commit
Perform the merge and commit the result. This option can be used to override --no-commit.

With --no-commit perform the merge but pretend the merge failed and do not autocommit, to give the user a chance to inspect and further tweak the merge
result before committing.

Basically, I just issue git merge --no-commit <branch> and inspect the results. If I don't like them, I issue git merge --abort, or if I want to commit the merge, I proceed normally with git commit.

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