Reputation: 75
I've searched the site for answers to this, and while I've learned a lot, I still have an issue that maybe someone can help with.
Our deb team has an internal Android repository forked from a google branch. We have to work with a customer, so I've set up a cron job to sync the repo on a customer-accessible machine. This makes the internal repository the master.
Now, of course, I have the customer needing to push updates, and they only have access to the external server. This leads to a conundrum: if I don't use "repo sync" to maintain the external repository staying in sync with the internal, it will effectively blow away any changes the customer pushes to the external repository mirror.
The most logical solution would be to make the external the master and force the internal to sync off of it, but I don't think I can convince the deb team to do that.
I've thought about post-commit hooks to sync with the internal, but it seems like they work only on an individual git repository, and I'd have to find all of the .git/post-commit files to make the change.
Is there any easier way to make this happen?
Upvotes: 1
Views: 295
Reputation: 10474
You should consider the external repo a fork of the internal repo and merge your results at appropriate times.
It really depends how you are working together with your external team.
But I assume you are working on similar code, so you would be merging back to the internal repo after a code review(?).
Your internal team is also working on forks of the repos, just locally. They may or may not have access to push directly to the repo - not sure.
You have to decide on your merge strategy, what gatekeeper you have between the repos, if none, then you should setup 2 post-receive hooks, one on the internal and the other on the external to keep the two repos in constant sync (initiate a pull/push to/from the other repo).
If you get an error in the hooks, you will have to manually correct the issue most likely - so remember to shoot out emails.
Upvotes: 1