git 向远程仓库push的问题
迷茫
迷茫 2017-04-22 09:00:39
0
6
783

一般在push的时候是不是都会先pull一下以保证代码最新,但是如果以下场景怎么办:

A:push,但是git提示过期于是进行pull,pull之后发现有冲突,然后merge
B:在Amerge的过程向服务器push了。
A:等他merge完,在push的时候服务器又变化了,再pull - merge
.....

这样会不会导致A一直没法push?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(6)
巴扎黑

The cause of the conflict generated during the first merge has been resolved locally. If the code pushed by others does not change this part, Merging again will go smoothly. Git will handle it automatically, so don't worry too much.

If conflicts always occur during merge, it means that the code in the conflicting part is extremely unstable. Developers need to communicate with each other to solve it completely, or use some methods to bypass it.

小葫芦

After merging, it will be a new version. After pushing finds other versions, continue to merge another version.

You can push it up one day.

PHPzhong

This problem should be solved in two ways: The first one: Only when the version difference is too large, you must pull + merge before you can push. But after you merge, if the version difference is not big, you can push. Second: Everyone should keep a branch of their own. First push to your own branch, and then merge from the server to the master.

巴扎黑

A and B can discuss and reach an agreement, and they will only rebase but not merge. In this way, history looks better, with one line and no chaos.

刘奇

If such a problem occurs, it means that the code coupling between A and B is too much and needs to be re-divided

迷茫

Since there is a conflict, just merge. Keep merging until there is no conflict between him and you, then you can push it up

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template