3 ms·
how do you create branches in mono repo? for example I want to use branch rev5 from project A and rev3 from project B how I do that in a mono repo, I could n
by bedros 8y ago
how do you create branches in mono repo?
for example I want to use branch rev5 from project A and rev3 from project B
how I do that in a mono repo, I could not do it in HG, but sure about GIT
- Tloewald 8y agoCan’t you create a branch and merge the two branches you are interested in into that?
- bedros 8y agomy understanding, if you branch, you branch the entire repo, (not sure about some special case extensions ) if you have two projects stored in a single repo, you are forced to use whatever rev at for each project at a point of branch rev 5543 for example
- ScottBurson 8y agoIn Perforce, which is more or less what Google is using, you can branch any directory within the repo. (You would never branch the whole repo; that makes no sense.) So if you wanted to construct a directory with one version of one subdirectory, and a different version of another subdirectory, that's quite straightforward.
- ec109685 8y agoGoogle branches google for releases. Otherwise, you would end up with version skew across dependencies, which would be a mess.
- Too 8y agoYep, and if you want to keep folders you didn't branch up to date with master you have to continuously rebase. Not having it this way would be equivalent to having subrepo that refers to HEAD instead of a specific commit which is normally considered an big anti-pattern. The best remedy is to not do branching like this in the first place, just try to stay on trunk all the time.
- aidos 8y agoDepends on the system. When I used to manage SVN we would branch independent projects and then releases would be a snapshot of each into the server section of the repo. Those were then pulled down to their respective machines. In SVN a branch is simply a convention. You copy (almost zero cost) things around into your branches directory
- tom_ 8y agoBranch rev5 of project A's folder into a folder in your project's folder, branch rev3 of project B's folder into a folder in your project's folder. Get your project to refer to its own copy, rather than the shared copies you branch from. (This isn't quite like git submodules, but that's probably the closest thing git has.) You do the usual 3-way merge thing to push your changes upstream, or pull upstream changes into your copy. As with git, the VCS tracks which revision of upstream your copy is up to date with, which is how it determines the base for the 3-way merge.