I have a repository, which is a fork of a public project. The fork contains several additional commits with custom features - nothing fancy. Recently, I have been wondering what would be the best approach of incorporating upstream changes into the fork. Currently the setup looks like the following:
- The fork has the
master
branch with these additional commits and another branch that acts like a staging branch (let's call itstaging
). - Every now and then I check if anything new has been released in the upstream repository.
- If yes, then I rebase
staging
first (staging also contains all these additional commits). This results in a GitLab pipeline which builds a Docker image and pushes it to a Docker repo withstaging
tag. After that, a k8s deployment is restarted and the new changes are available in thestaging
environment. - If everything is fine, I repeat the same process but this time I rebase fork's
master
against upstreammaster
(sometimes I simply reset--hard
master
tostaging
).
I feel like the whole process needs a bit of improvement. I was thinking about using custom tags in my fork, but these would be kind of "lost" with every rebase.
merge
workflow in that case would complicate things a bit. The thing is that I add new commits very sporadically to my fork and they are always on top of the branch - that is what seemed to be the simplest and cleanest solution for me.