Fork Management - armory/roer GitHub Wiki
We have a few different chunks of work in our local fork. The plan is to upstream all of them, but it takes a long time to get them into the open source project. And the open source project moves. But we want to run off our local version with all our changes.
So we've kept all the changes we're planning to upstream on different branches (docker-wrap, execution-history, exec-monitor) and then pulled them together into the dev branch to build the version we use. The Jenkins jobs we have use the dev branch to build a working container.
For the first few changes that come out of the open source project I was just rebasing the feature branches on our end, and then standard merging into the dev branch. That started to get ugly once we had changes of our own on the feature branches along with upstream changes. There were merges where I had to do manual fixups for each of almost a dozen chunks for 3 or 4 files each. So instead I swapped to using the dev branch as a pure integration branch. If we need to keep our fork going for any significant amount of time that'll probably be the easiest way to manage it. In that model each of the feature branches gets rebased and fixed, and then remerged into a completely new branch. Since we have tools driven off the dev branch though, I've just been renaming that new branch to dev and force pushing. So the process looks something like this:
- Sync to upstream, assuming you already have a remote setup for upstream.
- git fetch upstream
- git checkout master
- git merge upstream/master
- git push origin master
- Rebase each of the feature branches and resolve whatever conflicts come up.
- git checkout docker-wrap
- git rebase master
- git push origin docker-wrap
- git checkout exec-monitor
- git rebase master
- git push origin exec-monitor
- ... and on for each branch
- At this point each of the feature branches are clean, so we can use them to PR to upstream if needed. Now we just need to make a new dev branch for ourselves.
- git checkout master
- git checkout -b newdev
- git merge docker-wrap
- git merge exec-monitor
- ... and on for each branch
- Assuming everything is working, run tests off that newly created branch and all, you just need to rename your branch to dev and jam it down githubs throat.
- git branch -D dev
- git branch -m dev
- git push -f origin dev