GIT(DVCS) - 锁定或检出文件(如svn)并冲突合并文件 [英] GIT (DVCS) - Lock or checked out the file (as like svn) and conflict merge the files

查看:619
本文介绍了GIT(DVCS) - 锁定或检出文件(如svn)并冲突合并文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是从SVN转移到GIT。我已经通过了帖子和评论,但没有找到有效的解决方案。



我有一个下面的问题:


  1. 如何检出或锁定这些文件,其他开发人员是否知道该文件不可用并由
    此用户检出?


  2. 如果一个用户更新了其他用户正在处理的同一个文件,并且两个用户都将更改推送到主存储库。现在,它是如何解决冲突或合并的。

    冲突或合并如何工作。

    我们是否可以选择在tortoiseGIT中管理冲突或通过GIT存储库push命令进行内部管理。 ?

请让我知道上述问题的解决方案。



< git是一个分布式的vcs,所以你所做的任何事情都会在你本地的仓库中完成,而它本身并不知道其他开发商的本地仓库。因此,回答问题1:

由于git没有中央服务器存储库(您可以创建一个,但它只是您定义的中央存储库而不是git的设计),因此没有可以实现的实例锁定文件,如svn。



有详细的文章 here



合并冲突尽可能由git管理。如果无法解决,则会显示手动解决合并冲突。


I am just moving from SVN to GIT. I have gone through the posts and comments but not finding effective solution.

I have a below questions:

  1. How to checked out or Lock the files so, other developer is aware that file is unavailable and checked out by this user ?

  2. If one user has updated the same file where other user is working on and both have push the changes to master repository. Now, how it resolve the conflicts or merge.
    How conflict or merge works.
    Do we have a option to manage conflicts in tortoiseGIT or internally manage by GIT repositories push command. ?

Please let me know the above questions resolution.

Thank You.

解决方案

git is a distributed vcs so anything you do will be done to your local repository which itself is unaware of the local repositories of the other developers. So to answer question 1:
Since git doesn't have a central server repository (you can make one but it's only a central repository by your definition not by the design of git) there is no instance that can lock files like in svn.

There is a detailed article here on team workflows.

Merge conflicts are managed by git as far as possible. If it can't resolve it will show that a merge conflict exists for manual resolve.

这篇关于GIT(DVCS) - 锁定或检出文件(如svn)并冲突合并文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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