Codebase

Collection of source code maintained as a unit


title: "Codebase" type: doc version: 1 created: 2026-02-28 author: "Wikipedia contributors" status: active scope: public tags: ["source-code", "version-control"] description: "Collection of source code maintained as a unit" topic_path: "technology/software-engineering" source: "https://en.wikipedia.org/wiki/Codebase" license: "CC BY-SA 4.0" wikipedia_page_id: 0 wikipedia_revision_id: 0

::summary Collection of source code maintained as a unit ::

::callout[type=note] the source code of software systems ::

A codebase (or code base) is a collection of source code that is maintained as a unit. Typically, it can be used to build one or more software components including applications and libraries.

A codebase is typically stored in a source control repository of a version control system. A repository can contain build-generated files (which are therefore not source code), but typically such files are excluded from a repository, and therefore the codebase. A repository may contain data files (such as configuration) that are required for building or running the resulting software. But version control is not a required aspect of a codebase. Even the Linux kernel was maintained without version control for many years.

When developing multiple components, a choice is made either to maintain a separate, distinct codebase for each, or to combine codebases, possibly in a single, monolithic codebase. With a monolithic codebase, changes to (i.e. refactoring) multiple components can often be easier and robust. But this requires a larger repository, and makes it easier to introduce wide-ranging technical debt. With separate codebases, each repository is smaller and more manageable. The structure enforces logical separation between components, but can require more build and runtime integration between codebases, and complicates changes that span multiple components.{{cite conference |title=Searching for Build Debt: Experiences Managing Technical Debt at Google |author=J. David Morgenthaler |author2=Misha Gridnev |author3=Raluca Sauciuc |author4=Sanjay Bhansali |name-list-style=amp |year=2012 |book-title=Proceedings of the Third International Workshop on Managing Technical Debt |pages = 1–6 |publisher=IEEE |url=http://research.google.com/pubs/pub37755.html |doi=10.1109/MTD.2012.6225994

Examples

Some notably large codebases include:

  • Google: monolithic, 1 billion files, 9 million source code files, 2 billion lines of source code, 35 million commits in total, 86 TB total size (January 2015)
  • Facebook: monolithic, 8 GB (repo 54 GB including history, 2014), hundreds of thousands of files (2014)
  • Linux kernel: distributed, over 15 million lines of code ( and kernel version 3.10)

References

References

  1. "A Short History of Git".
  2. (2014-01-07). "Scaling Mercurial at Facebook". Facebook Code.
  3. "Git - Distributed Workflows". git-scm.com.
  4. (24 June 2016). "Why Google stores billions of lines of code in a single repository". Communications of the ACM.
  5. (April 24, 2014). "Facebook's git repo is 54 GB.".
  6. (2000-11-05). "Essence of distributed work: The case of the Linux kernel - Moon - First Monday". [[First Monday (journal).

::callout[type=info title="Wikipedia Source"] This article was imported from Wikipedia and is available under the Creative Commons Attribution-ShareAlike 4.0 License. Content has been adapted to SurfDoc format. Original contributors can be found on the article history page. ::

source-codeversion-control