Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you share your git repository with other developers?

Tags:

git

I have a central git repository that everyone pushes to for testing and integration, but it only is pushed to when features are 'ready'. While in the middle of a big task, developers frequently have many commits that stay on their hard drives.

Sometimes in the middle of these projects I'd like to either see what another developer is doing, or show him how I've done something. I'd like to be able to tell another developer to just "pull my working copy".

The only way I can think of is having everyone run SSH on their development machines and adding accounts or SSH keys for everyone, but this is a huge privacy and permissions nightmare, and seems like a lot of work to maintain.

Should we just be pushing to that central repository in these cases? Should we be pushing after every local commit?

like image 672
semi Avatar asked Mar 13 '10 01:03

semi


People also ask

How do I share a Git repository with others?

Under your repository name, click Settings. In the "Access" section of the sidebar, click Collaborators & teams. Click Invite a collaborator. In the search field, start typing the name of person you want to invite, then click a name in the list of matches.

How do I create a collaborative git repository?

Create a Collaborative Repo Go to the repository settings (click the Settings tab in your repository or go to: https://github.com/<username>/hello-world/settings/access ) and then invite your partner to have access to the repository. Your partner will need to go to their email to accept the invitation.


2 Answers

Two common approaches:

  • developers have their own public repos (for example mpd and associated programs).
  • developers push to refs in their own namespace on a central repo (dev1/master, dev2/master). Depending on your exact situation, you might want some access control in the form of hooks to make sure no one does anything silly.
like image 159
Cascabel Avatar answered Sep 18 '22 00:09

Cascabel


We use branches for code that isn't "ready" yet, and the branches get pushed to a central repo (which is backed up!). When a new feature becomes "ready" it gets merged into the master branch.

One of the benefits of using git is that it is very, very easy to create and merge branches, plus you can visualize what's happening using gitk. Recommended!

like image 37
Norman Ramsey Avatar answered Sep 19 '22 00:09

Norman Ramsey