Source code should be versioned so that changes to your code can be undone, should you run into unforeseen issues. We should also have clear visibility on who did what, when, how, and why. With classic SharePoint solutions, such as full-trust code projects, the versioning system was typically Microsoft's Team Foundation Server (TFS), an on-premises service that could be deployed locally. It would provide a portal for accessing different team projects, managing tasks, bugs, project schedule, and resources. TFS is still widely used, but it's fairly complex to deploy and configure, and numerous version upgrades in past years have proven that such services can also be provisioned as cloud-based services.
For the SharePoint Framework-style projects, you should typically choose either GitHub.com (a third-party cloud service), which allows you to store your project data and code in a private or public repository, or Visual Studio Team...