简体   繁体   中英

How do you share your git repository with other developers?

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?

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.

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM