Source code management is the practice of tracking modifications to source code. Keeping a running history of the changes made to a codebase helps programmers, developers and testers ensure that they’re always working with accurate and up-to-date code and helps resolve conflicts when merging code from multiple sources.
Source code management is important because multiple developers typically work in a shared codebase. And with each developer working on their respective feature, they could unknowingly make conflicting code changes — or one developer’s saved edits could overwrite the other developer’s changes.
Before the adoption of source code management, there were few safeguards to prevent these scenarios. Each time a developer started working on a file, they would have to let all the others know to ensure no one else was working on it simultaneously.
That said, it was hardly a foolproof process. And when it worked, this method left no record of all the changes made over the course of a project — if a change resulted in a bug, there was no way to trace where it originated or determine how to fix it.
Source code management solves these problems by tracking each developer’s changes, highlighting conflicts and preventing code overwriting. Developers are alerted to any conflicts so they can address them before they are merged into the source code and potentially compromise the application.
In the sections that follow, we’ll take a closer look at how source code management works, what benefits it brings to software development, and which best practices to follow to get the most out of the process.