开发者

How do you share your git repository with other developers?

I have a cen开发者_如何学运维tral 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!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜