How to use git for multiple developers

Here's a very basic question for an experienced Git user. I created a repository on Git hosting and configured my computer:

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

      

Then, after some changes:

git add .
git commit
git push

      

All these steps are performed on the first development computer.

Now the question is, how does the second developer access the repo? First of all, does it have to clone the repo?

+2


source to share


2 answers


Yes, you would use a clone. You must also set the sharedrepository config option:

git config core.sharedRepository "true"

      

You should also know, with multiple contributors, that the fetch option will allow you to see the changes in the main repository and how they will apply to you:



git fetch
git diff origin

      

or you can just go through the list of files and split each separately:

git diff --name-status origin

      

+6


source


Yes. It will be

 git clone $giturl
 git add .
 git commit
 git push

      



for him.

+3


source







All Articles