As you begin to build data and write code you may need to share with colleagues, or, if a mishap occurs, be able to roll back to a previous version of your code. Project Evident recommends version control in nearly every code scenario.
How do I keep track of code changes, and different versions of code in a structured way? How should I share code (between staff members, with contractors, etc.)? If these are questions you've run into, Version Control software may be helpful.
Version Control (also called Source Control) is software that keeps track of code and how it changes over time. It is indispensable for code “in production,” where changes need to be made carefully with with the possibility to “roll back”. When working with code that you depend on, you should be able to try out changes with the confidence that if things don't work out, you can easily revert to a previous working version. It is invaluable for managing changes when more than one person is modifying a codebase.
Version Control is recommended whenever you are working with code that you want to use long term, especially when you are iterating and adding new options and features, but want the option to roll back changes to an older version of the code. A small project by one person doesn’t necessarily require version control, but it can be a nice way to ease in to the good practice.
Version Control is strongly recommended if the code is “in production” in any sense (driving regular reports, supporting a tool, dashboard, or website that people depend on), and is strongly recommended if there are multiple people working on the same coding project.
Version Control is a technical tool that only needs to be used by staff who are actively making code changes. Using Version Control adds a layer of complexity to a workflow, so we recommend waiting to use a Version Control system until you are comfortable with non-Version Control workflows (or have a mentor to help out).
Git has become the defacto standard for Version Control. Alternatives to Git include SVN and Mercurial; however, we recommend Git due to its dominance and because it is free. There are several options for services that will host a Git server in the cloud, which stores and backs up your code and provides a nice online interface. These sites will also let you manage user permissions, keeping your code secure and private, or sharing it, as appropriate.
Github is the most popular of these sites, but not making private repositories available in its free tier means that most organizations will need a paid plan. That being said, if you are collaborating on code projects outside of your organization, Github's popularity may make it worth the (still low) price.
Github is the most favorable option because of its popularity—if you need to collaborate on a coding project with anyone, they probably already have a Github account. Project Evident recommends that eligible nonprofits create an organizational account and upgrade to the free Github for nonprofits plan, which provides unlimited users and unlimited private repositories. Nonprofit organizations are eligible if they are nongovernment, nonacademic, noncommercial, nonpolitical in nature, and have no religious affiliation.
GitLab allows unlimited private repositories and users even in their free tier. These are two of the most useful features for small nonprofit organizations, and it's very nice that GitLab offers them for free without Github's extra eligibility requirements or jumping through the hoop of sending proof of your tax-exempt status. The only reason GitLab ranks below Github is because it is less popular–meaning people you hire and collaborate with are less likely to already be familiar with GitLab.
Bitbucket also allows unlimited private repositories for free, but it has a restriction on the number of users. Additionally, Bitbucket’s extra features are directed at an advanced software developer audience (e.g., pipelines and build time on servers for compiling applications), and won’t be needed by most social sector nonprofits.
Git can be confusing for new users. Below are some recommended resources for getting started with Git: