Fork maintenance — keeping your changes in sync with the latest updates from the original project — can quickly become a mess. Trust me. Over the

How to fork: Best practices and guide

submited by
Style Pass
2024-10-15 02:00:02

Fork maintenance — keeping your changes in sync with the latest updates from the original project — can quickly become a mess. Trust me. Over the years, my work did sometimes involve maintaining forks of various open-source projects. That’s not the case with my job now, but when a colleague reached out for help with a fork that hadn’t been rebased in ages, it got me thinking that the steps I follow might be useful for other developers too. Hence this article.

Certainly the topic of fork maintenance can be complex enough that what works for me is not adequate for other developers. At the same time, hopefully the advice in this article makes sense for someone out there.

Though these terms will be familiar to those working in open source. For the sake of completeness, let’s have this note on these concepts. Upstream indicates the project you have forked, including any changes and code that the project maintainers keep adding. Downstream means your fork and the changes you are adding or keeping on top of it.

Before we go into the sections, as kind of an obvious step 0, I recommend anyone to get acquainted with git concepts! I know this sounds so basic that perhaps I could have skipped writing it. But I have seen many developers using git without fully understanding some base concepts. This article assumes knowledge of git without expecting an expert level of it, and focuses on the git CLI. I understand there are many other tools out there to handle git that are maybe more beginner-friendly, and I encourage everyone to use whatever makes their lives easier, but the git CLI is a good way to keep the article also neutral and future-proof.

Leave a Comment