I forked a GitHub project, implemented a few features and fixed a few bugs in separate branches, sending pull requests for all of them.
While waiting for them to be accepted into upstream, I want to use all these features and fixes. For that, I create a branch 'my-master', from 'upstream/master' and merge all changes from other branches which are not yet in upstream. I also write a list of applied patches into the README.md.
When one of my patches goes to upstream, there is no reason to keep that branch any more, so I delete it.
It works, BUT, here there is a problem with such approach:
From time to time, I need to rebase all my unaccepted branches, to keep them up to date. After that, I have to recreate 'my-master' branch and update its README.md again.
Is there a way I can speed up or automate this?
Please, don't advise me to try git-up
. It is useful, but does a different thing.
One technique is to rebase your branch onto the upstream each time there is a release. You may want to create a tag at the old branch tip, or a dated-versioned branch name so that you don't lose your old history after garbage collection.
Or you may want to use the merging rebase script that msysgit uses https://github.com/msysgit/msysgit/blob/master/share/msysGit/merging-rebase.sh, which creates the impression of a continuous line of development (via the second parent) that is equivalent to the above rebasing processes.
In both cases you retain a set of commits that you were happy with should your rebase fixes (from conflicts) end up being problematic.
This covers two problems:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With