简体   繁体   English

Github Windows客户端合并失败

[英]Github Windows Client merge failure

We currently have 2 developers working on a project and use Github and the Github-Client for Windows. 目前,我们有2个开发人员在一个项目上工作,并使用Gi​​thub和Windows的Github-Client。

Our Github branches: 我们的Github分支机构:

  1. master
  2. pre_production (clone from master) 生产前(从母版克隆)
  3. dev_1 (clone from master) dev_1(从master克隆)
  4. dev_2 (clone from master) dev_2(从master克隆)

The basic idea being, 2 branches for development, which are then pushed to pre_production and then tested in the pre_production server; 基本思想是2个开发分支,然后将其推送到生产前,然后在生产前服务器中进行测试; then when everything is working fine, pushed to master. 然后当一切正常时,将其推向高手。

I'm not sure if the above is the correct workflow, as I'm pretty new to Git. 我不确定以上内容是否正确,因为我对Git还是很陌生。 Anyway, we were testing the workflow and we did the following steps: 无论如何,我们正在测试工作流程,并执行以下步骤:

On Dev1 machine 在Dev1机器上

  1. Made a change in local dev_1, synced with remote dev_1 更改了本地dev_1,并与远程dev_1进行了同步
  2. Merged local dev_1 into local pre_production (since pre_production hasn't changed yet) 将本地dev_1合并到本地pre_production中(因为pre_production尚未更改)
  3. Synced local pre_production with remote pre_production. 已将本地预生产与远程预生产同步。
  4. Merged local pre_production into local dev_1 将本地pre_production合并到本地dev_1
  5. Synced local_dev1 with remote dev_1 已将local_dev1与远程dev_1同步

On Dev2 machine 在Dev2机器上

  1. Made changes in local dev_2, synced with remote dev_2 在本地dev_2中进行了更改,并与远程dev_2进行了同步
  2. Switched to local pre_production and synced with remote pre_production 切换到本地预生产,并与远程预生产同步
  3. Merged local dev_2 into local pre_production 将本地dev_2合并到本地预生产中
  4. Synced local pre_production with remote pre_production 本地预生产与远程预生产同步
  5. Merged local pre_production into local dev_2 将本地pre_production合并到本地dev_2

It worked fine up to this point. 到目前为止,一切正常。 Then when we tried to merge the changes made by dev2 into dev1 it failed while syncing local dev_1 with remote dev_1 (at step 5). 然后,当我们尝试将dev2所做的更改合并到dev1中时,在将本地dev_1与远程dev_1同步时失败了(在第5步)。

As we are new to Git, it would be great to have some help. 由于我们是Git的新手,所以能获得一些帮助将非常棒。

Ok looks like I found the answer to my question. 好的,看来我找到了问题的答案。

In step 5, instead of trying to 'sync' the local_dev and the remote_dev, we simply forced a push to the remote_dev. 在第5步中,我们没有尝试“同步” local_dev和remote_dev,而是简单地强制推送到remote_dev。 We can do this safely as the local_dev will have the latest changes and not the remote one. 我们可以安全地执行此操作,因为local_dev将具有最新更改,而不是远程更改。

Did it using the below command: 是否使用以下命令:

git push git_url local_branch:remote_branch git push git_url local_branch:远程分支

Hope this helps someone. 希望这对某人有帮助。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM