Why can’t you merge in a bare git repo?

寵の児 提交于 2019-12-05 13:26:28

As Chronial points out, pushing does fast-forward merges or forced updates, which just moves references/branch pointers to a different commit.

In an actual non-fast-forward merge, you need a working copy in the case that you get conflicts that you need to resolve. It's been mentioned before by other Stack Overflow users; for example, see this answer (emphasis mine):

git performs all merge-y operations (real merges, cherry-picks, rebases, patch application) on the work tree. This is mentioned several times before, for example in one of the knowledgeable Jakub Narębski's answers:

There is no way that merge (or rebase) can work without touching the working directory (and index), as there can be merge conflicts that have to be resolved using working directory (and/or index).

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