开发者

tracking remote repository from another remote in git

Gosh, there are so many answered questions but i'm not sure about any of them.

Prerequisites:

  1. My projec开发者_Python百科t has main repository on github.
  2. My project has repository on sourceforge as well

Expected results:

  1. While developing i am pushing to my github repository (simple git push).
  2. Someone is cloning sourceforge repo (simple git clone).
  3. Someone is pushing his changes to sourceforge repo (simple git push).
  4. Both, sourceforge and github are still in sync.

Questions:

  1. Is it possible to configure something like this?
  2. I don't need backup. It would be good if sourceforge wouldn't have to fetch/send any data from/to github (so they wouldn't have to waste resources). So, generally - sourceforge should provide some kind of link to github repository, and this link should be automatically accessed at initial git clone .

Sorry, i'm adding a new question on this topic but i'm too confused what to use, if it will work, and most importantly - if it wont make a mess in my repo. I expect this would be something like remote tracking repo :)


There isn't really a good way to do this, no. Perhaps just provide a link to Github from your project's Sourceforge page instead?


The reason it can't be automated is that you have a potential to introduce conflicts that only a human can resolve. If you really want to keep them in sync a human will have to pull from both, resolve any conflicts, and then push to both. Alternately, you could make one of the repositories read-only, so other people can pull from it, but only one person can push, which eliminates the potential for conflict. However, unless you have a really good reason for keeping it duplicated, I would recommend closing one of the accounts.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜