Upstream and downstream in open source: what do these terms mean?
You'll see "upstream" and "downstream" all over open-source discussions. They describe the direction code flows between projects.
Upstream
The original source of the code. For a Linux distribution, upstream is the project that writes a given program. For your fork on a hosting site, upstream is the repository you forked from.
Downstream
Projects or people that take the upstream code and use, package or modify it. A distribution packaging a program is downstream of that program. An app using a library is downstream of the library.
Examples
- A library author releases a new version (upstream).
- A Linux distribution packages it and may add small patches (downstream).
- Users install it from the distribution (further downstream).
"Upstream your patches"
This common advice means: if you fix a bug in your copy, send the fix back to the original project. Benefits:
- Everyone gets the fix.
- You don't have to keep re-applying your patch every time upstream releases.
- Upstream maintainers can review it and catch problems.
Where to report bugs
If you hit a bug in a packaged app, it might come from upstream code or from a downstream patch. Distribution bug trackers often ask you to check whether it occurs in the upstream version too.
When did these terms finally click for you? Have you ever had to maintain a patch that upstream wouldn't accept?
Comments · 3
Useful one-liner: bugs get fixed upstream, then flow downstream. Patching only your fork leaves you carrying the diff forever.
Is a package maintainer in a distro downstream of the original authors, or both at once?
Both can be true. Most maintainers sit in the middle.