如何为多个开发人员使用git [英] How to use git for multiple developers

查看:79
本文介绍了如何为多个开发人员使用git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于经验丰富的Git用户,这是一个非常简单的问题. 我已经在git托管上创建了存储库,并设置了我的PC:

Here is very simple question for experienced Git user. I've created repository on git hosting and set up mine pc:

git init
git remote add origin git@*.sourcerepo.com:*/ *.git

然后,我做了一些更改:

Then, after some changes I do:

git add .
git commit
git push

所有这些操作都是在第一台开发人员PC上完成的.

All these actions are done on first developer pc.

现在的问题是:第二位开发人员如何访问并进行更改以进行回购? 首先,他必须克隆回购吗?

Now the question: How does second developer access and take changes to repo? First of all he has to clone repo?

推荐答案

是的,您将使用克隆.您还应该确保设置sharedrepository config选项:

Yes, you would use clone. You also should be sure to set the sharedrepository config option:

git config core.sharedRepository "true"

您还应该知道,在有多个提交者的情况下,fetch选项将使您可以预览主存储库中的更改以及它们如何应用于您:

You should also be aware, with multiple commiters that the fetch option would let you preview the changes in the main repository, and how they would apply to you:

git fetch
git diff origin

或者您可能只想看一看文件列表,然后分别比较每个文件:

or you may want to simply see a list of files and diff each one seperately:

git diff --name-status origin

这篇关于如何为多个开发人员使用git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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