Or how to live with Git remote repositories auto synchronized by the Convention over Git.
How to work with the Convention over GitUse Git, as you always do, except for the following.
- Name branches and tags with a prefix of your side (as an example "company/some_branch_name").
- Do plain commits to prefixed branches of your side.
- Delete only branches and tags of your side. Deleted by you refs from other sides will be recreated automatically.
How to migrate your work to another side refsAll refs will be updated on all sides automatically.
But when you will want to migrate your work to another side, you will do one of the following.
By a merge or cherry-pick from your side
- Do a plain merge from you prefixed branch to a prefixed branch of another side.
- After a synchronization interval do "git fetch" and check your merge-commit is still there.
- If not, then just repeat everything.
Commits between different sides may disappear if somebody else do a "git push" to the same branch before you.
The auto conflict resolving of Convention over Git will delete your merge-commit only in a case of non-fast-forward differences. This is not so often.
By a merge or cherry-pick at another side.
Nobody doing so :-)
This works if your can connect to a remote Git repository of the other side.
Wait the sinсhronization interval and your commits will appear on the remote repository of the other side.
Do a merge between branches there.
Now this is safe. No checks, no worries. Done.
By a plain commit on your side to an other side ref.
Junior developers doing so. Prevent this.
If you feel lucky you can do a plain commit directly to a branch of the other side.
Again, you must recheck you commit is still there after a synchronization interval.
And if you're unlucky then you'll end up searching your commit in the Git-reflog. It is time wasting operation. I warned you.
So, be careful or inform guys on the other side.
Out of convention refsIn the provided implementation mode of the Convention over Git, the sides only see conventional (prefixed) refs.
Not-prefixed branches and tags will stay undisclosed for other sides. They even can have the same names on different remote Git repositories.