Sarun Sermsuwan
Sarun Sermsuwan

Reputation: 3818

multi-developer development setting with Git

First of all, I'm a fresher in Git. I come from SVN background, where developers work through checking in/out code against a shared repository.

What do I do with Git to enable multi-developer development?

From my understanding, is it correct if each developer will have his/her own individual local repository for each, but share one remote repository that would sit somewhere on the server.

Is my understanding correct? Where do I find a good reading on this?

Thanks in advance!

Upvotes: 0

Views: 180

Answers (3)

Kim Burgess
Kim Burgess

Reputation: 467

The nice thing about Git is that it is extremely flexible. The best workflow for your situation is completely dependent on how you and your co-developers like to interact.

To get up and running in a multi-developer environment all you need to do is have some way to fetch / push between your repositories. This can either be directly between each other or via a central authority, or 'blessed' repository and can be done via ssh, a file share, https or even just duct-taping a thumb drive containing the 'blessed' repository to a carrier pigeon.

An excellent free resource when it comes to helping you get started is Pro Git, which includes a good chapter on Distributed Workflows. Also, have a look at "A successful branching model" for a well designed way to keep everything organised.

Upvotes: 0

udo
udo

Reputation: 5210

There are

  1. Local Version Control Systems (locally on your dev machine, e.g. when you check out code)
  2. Centralized Version Control Systems (like svn, cvs)
  3. Distributed Version Control Systems (like git, bazaar, mercurial)

The workflow of Distributed Version Control Systems like git in combination with github is the following:

  • repository (3) owner
    • grants access to project contributors
    • approves pull request (explained later)
  • contributor
    • forks the remote project and has it available in his repository account (3)
    • clones the project and has it available locally (1)
    • commits locally and pushes changes to his project repository as necessary (so changes are not lost when his local machine crashes...)
    • during development he fetches and merges commits from the remote (main) repository regularly so he stays close to ongoing development trunk
    • if he has a working solution he sends a pull request to the repository owner
  • repository owner
    • accepts or denies the pull request
    • if accepted, the changes are merged to the main repository

Important: This repository "hierarchy" can be extended to other contributors which are contributors of your repository.

Good resources are the following:

Upvotes: 1

s.m.
s.m.

Reputation: 8043

Yes, your understanding is correct. You don't have to do anything to "enable" a multi-developer scenario.

You just need a repo where everyone can push changes to (and pull changes from).

This might help you.

Edit

Let me add a few more words. Even if git is a distributed source code management system, most of the times you will still have a "blessed" central repository, one you will consider to be your "official" one.

The difference is that, git being distributed, every developer will have a clone of that official repo, containing all the entire history.

The many reasons why this is such a Good Idea®, well, you'll figure them out on your own, trust me.

Upvotes: 2

Related Questions