Setting Git for a team of 3 people?
Asked Answered
K

4

15

The post aims to summarize all pieces of information to set up a closed repository for 3 people in a competition. Please, feel free to add a problem to the list which I have not noted. Please, add each answer to each question as a separate answer.

  1. Situation A: Drafts and files can exchange between 3 people. The writer can only push files to the repository.
  2. Situation B: Similarly as above, but all team mates can push files to the repository.

The general problems about Situation A

  • How can you set up remote branches for people A, B and C, so that team members can see files which their team members want to share?
  • How can you set up the person A as a dictator, who can only push changes to the sacred repository?

Initial Problems about Situation A

  1. How can you set up a Git repository, where people A, B and C can pull? I assume Git is already successfully installed to the repository
  2. How can you allow the writer only push?

Advanced Problems about both Situations

Kwok answered 15/2, 2009 at 14:1 Comment(0)
L
13

Situation A

It sounds like you want to set up a integration manager workflow. In this scenario, person A creates an initial repository which is the sacred repository. Each person, A, B and C, clones that repository for their personal work. When person B or C has something they want A to include in the repository for sharing, they commit it to their local repository, and ask A to pull from their repository (a pull request); person A sets up remotes for person B's and person C's repositories and then can git pull personB or git pull personB to merge in the changes. Person A then git pushs the merged changes into the sacred repository.

You can set up the cloning and pushing over a variety of transports. The easiest is to use the git protocol over ssh. e.g.,

  1. Person A makes the sacred repository: see 'Creating a remote repository' at this page from 37signals. Let's say it is in /local/git/project.git on sharedhost. You can leave out the --shared=group since you want it to be an integration repository. (Write access here is protected using Unix file permissions.)
  2. Person A, B and C, in their home directories, clone that repository.

    cd ~/src
    git clone ssh://sharedhost//local/git/project.git
    cd project # edit files in here.
    git commit
    
  3. Person A sets up remotes for B and C's repositories.

    git remote add personB ssh://sharedhost/~b/src/project
    git remote add personC ssh://sharedhost/~c/src/project
    
  4. Now person A can git pull personB to fetch B's changes. When A is happy, he will git push to push the newly merged changes to the shared repo and B and C can git pull to fetch them.

If setting up the repositories sounds a bit complex, you may want to pay a provider such as GitHub to handle all the hosting of shared git repositories for you. They also have support where they can help you out with problems. For me, I found that the trickiest part is understanding the flow of commits. Once you get that, things start to make more sense. This discussion at gitready.com might help clarify things for you. There is also a screencast that covers similar material.

Llywellyn answered 15/2, 2009 at 15:23 Comment(1)
We also use the integration manager workflow. It is beautifully productive and secure, and scales nicely to any team size. In our experience, setting this up was easy in terms of technicals, but the mental change was not that trivial for developers. That's why we made a short tutorial video for our own team, that we later published on YouTube: What is the Integrator Workflow?Adown
K
1
  1. How can you set up a Git repository, where people A, B and C can pull?

You need to use ssh -protocol (ssh username@ipAddress), and provide ssh access to 3 people, by providing an account for them on the machine that hosts the repository (Source).

I recommend to provide SSH keys for your team members. Please, see the post. This allows them to clone by running, for instance:

git clone user@machine:/path/to/repo.git

A developed problem

How can you provide an account for 3 people?

If your files must be private, I recommend you to have an account at Github which costs you a few bucks. You can also set up a repo at your own server by Gitosis.

If your files can be open, I recommend you to use Github, since it is free for that purpose.


A more developed problem

How can you add an user to your Git repository?

You can add an user to your team by running the following code at your Git branch

git add remote UserName ssh://ADDressToTheRepo

Example of the command

git add remote schacon git://github.com/schacon/ticgit.git

A more-more developed problem

How can you add your friend's branch to your Git?

Please, see my answer at the thread.

Kwok answered 15/2, 2009 at 14:1 Comment(1)
it is definitely possible to use setuptools without sudo access, you have to add some options (why setuptools requires those is another story...). The options are: python setup.py --single-version-externally-managed --record=/dev/null --prefix=myprefixDandle
K
0

How can you report bugs efficiently to your team mates?

I had a problem in reporting bugs and feature requests to my team mates.

The software TicGit solves the problem for me. It is a ticket system for Git, which you can install simply by setting it up as a separate branch to your project.

Kwok answered 15/2, 2009 at 14:1 Comment(0)
K
0

One suggested me the use of Gitosis, which raised a new problem: How can you set up Gitosis to your server by first setting up Python-setuptools, when you do not have sudo access?

Solution to install Gitosis: Please, see the post to install the newest Python. Note that your system probably has an old Python. You cannot update the system-Python without updating the whole OS. For example, you cannot update Mac Leopard's Python because the system depends on it.

Now, you can start to install python-setuptools. Please, see the post to install them.

Kwok answered 15/2, 2009 at 14:1 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.