使用GitHub进行多次提交时出现问题 [英] Problem with multiple commits with GitHub

查看:90
本文介绍了使用GitHub进行多次提交时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi
我们在版本控制中进行多次提交时遇到问题,当我们使用GitHub for windows时。

我们正在尝试使用相同的文件同时进行提交。 />
当2个人同时推送提交时,只有一个提交被注册,另一个被终止(它没有通过)。我知道这样做的方法,但我对GitHub很新。有人可以提供一些建议吗?真的很适合它!!



祝你好运Daniel

Hi We have problem when doing multiple commits in our versioning,when usin GitHub for windows.
We are trying to do commits at the same time using the same file.
When 2 people at the same time pushes commit, only one of the commit´s is registered, the other one is terminated(it doesnt go through). I knoe there´s a way for doing this, but i am pretty new to GitHub. Is there somebody that could give some advice? Would really aprpeciate it!!

Best regards Daniel

推荐答案

Hello Daniel,



以下是GIT Doc的摘录。
Hello Daniel,

Following is an excerpt from GIT Doc.
推送到远程分支机构时遇到的最后一个主要问题是有人在此期间推进。如果你和另一个开发人员同时克隆,你们都做了提交,然后她推,然后你试图推,Git默认不允许你覆盖她的更改。相反,它基本上在你试图推送的分支上运行git log,并确保它可以在你的推送历史中看到服务器分支的当前提示。如果在历史记录中看不到服务器上的内容,则会断定您已过期并拒绝推送。您将正确地获取,合并然后再次推送 - 这确保您考虑到她的更改。
The last major issue you run into with pushing to remote branches is the case of someone pushing in the meantime. If you and another developer clone at the same time, you both do commits, then she pushes and then you try to push, Git will by default not allow you to overwrite her changes. Instead, it basically runs git log on the branch you''re trying to push and makes sure it can see the current tip of the server''s branch in your push''s history. If it can''t see what is on the server in your history, it concludes that you are out of date and will reject your push. You will rightly have to fetch, merge then push again - which makes sure you take her changes into account.



简而言之,不仅仅是GIT,而且其他VCS也不会允许这种情况发生。这就是现代VCS的工作方式。



问候,


In nutshell, not just GIT but other VCS will also not allow this to happen. That''s the way modern VCS works.

Regards,


这篇关于使用GitHub进行多次提交时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆