“What do you call a code repository?” I asked a developer friend for a definition in simple and understandable language.
“Hm,” she considered the question. “I never really thought about it. I just push the code to the GitHub repo, when I’m done with that feature or bug fixing, and I never stopped to think about the definitions.”
Whether you’re new to software development or you finally decided to dig deep into the understanding of what code repositories do, this article will concentrate on questions like “What does source code repository mean?”, “What is the best source code repository?” and “How to choose the repository for your project?”
What is a code repository?
If you are a developer, you’ve heard the name GitHub or BitBucket at least once – these are an example of code hosting service platforms.
The world of open-source software thrives on collaboration. This collaboration takes place within repositories – digital archives that store not just the code itself, but also its history, documentation, and other essential assets. These repositories can be public (open-source) or private, allowing developers to share and contribute code freely or maintain control over their projects.
JavaScript Reigns Supreme
Among open-source projects, JavaScript stands as the current leader. However, languages like PHP and .NET follow closely behind, demonstrating a diverse and vibrant open-source landscape.
Check out the statistics from Statista below on active public repositories that rely on open-source software worldwide:
What can a source code repository do?
- Version Control: No more panicking when “everything went bad”! Repositories meticulously track every change made to your code, allowing you to pinpoint edits and revert to previous versions if needed. Plus, you can see who made the changes, promoting transparency and accountability within your team.
- Streamlined Collaboration: Working with other developers becomes effortless. Multiple developers can work simultaneously on the same project, modules, or even lines of code, seamlessly merging changes without conflicts.
- Teamwork Champion: Source-code repositories embody teamwork principles. By fostering open collaboration on the codebase, they encourage knowledge sharing and problem-solving together.
- Production Ready: When your project is ready for deployment, you can leverage the repository’s structure to prepare your code for release to the production environment.
What is the purpose of a code repository?
Version control for your project is critical. Even if you’re the only developer on the team, the chances are that you’re human, and you might make a mistake and delete an extra semicolon, sending your beautiful code running into disarray. Version control provides an opportunity to go back.
Code repositories are great community builders. While there are some tricks you might not want to share (or that are protected by the NDA of a company you work for), committing to a joint project or submitting a bug fix to your favorite JavaScript framework is suitable for everyone involved. Your favorite framework becomes even better, and everyone else is grateful to you for fixing that nagging error.
Code repositories are great digital portfolios or resumes. For a developer, a GitHub repository or committing to an open-source project are the best CVs possible. You can tell all you want about your excellent hard skills, but providing a link to your code repo would make it more believable. For companies, allowing the developers time to contribute to open-source projects also pays off because it promotes creativity as well as encourages continuous learning.
Besides the features mentioned above, many source code repositories also offer built-in bug-tracking systems, wiki-based project documentation, and release management.
What can the code repository contain?
- Commit objects’ set
- References to commit objects (also known as heads)
- A historical record of the repository code changes
Who uses the source code repositories?
Everyone who is involved in the project should have access to the repository – frontend and backend developers, project managers, HTML layout developers, QA engineers, etc. – everyone who needs access to the code, tests, and technical documentation.
Code repositories can be for single developers, multi-developer projects, and open-source software projects (which are a sort of multi-developer, but anyone can easily access the code, whereas the former is shared with a specific set of users.)
Single-developer projects can be stored locally, on a server, and in the cloud. Multi-developer and open-source projects are stored online on a server or a cloud, to allow easy collaboration between the users.
Since several people can edit code repositories, there are two terms you should also know about that are essential to this case:
- Branch – when you want to diverge from the main code line, you can “branch” the code from the main “trunk.” The repository code branch remains part of the original repository, and the branch relies on the trunk. If the original code is deleted, the branch has no support either.
- Fork – when you want to go a completely different way, you can fork the main repository, which means you copy or clone the original and take it from there. The fork, unlike a branch, does not rely on the original repository and will remain if the source is deleted. It becomes its new trunk.
The traditional composition of a repository is a trunk, branches, and tags. Branches usually contain new versions of the code, which can be either discontinued or merged with the main trunk code.
Why is a code repository necessary?
What is a code repository used for? It’s a way to publish your amazing code to a production server without the hassle of walking to the lead developer the file archives on a flash drive or uploading the file to the production server via SSH or FTP…
But what do you do if there is an error in your code, and you urgently need to fix it? Without a repository management system, you would have to unpack your code once again, look for the error, fix it, and repeat the previous steps… Too long.
With GitHub or BitLocker, for example, this process becomes much simpler and straightforward (not to mention safer for the production server and your end-users.)
As we have discussed above, repository management solutions (also known as Version Control Systems or VCS) have many other useful features:
- You can work on the same project wherever you are without relying on your local storage for the project.
- You can collaborate with numerous other developers on a company product or contribute to an open-source project that would benefit the community as a whole. (Otherwise, you would have to compare the code from different developers and unite it manually into one coherent archive.)
- You can enjoy the simplified debugging options thanks to side-by-side code comparison, which highlights the things that were changed in the latest versions.
- You can revert to the previous version (or find out who broke the code or fixed a critical bug.)
Distributed Version Control Systems Advantages
There are two main types of code repository platforms – centralized version control systems (VCS) and distributed version control systems (DVCS). The former is an older kind, where there is only one central code repository, and you, as a developer, can contribute only to that repository.
If you don’t have access to the Internet and the code is located on an external server, bad luck – you can’t commit your changes. An example of such a system is Subversion (aka SVN) and CSV.
Thankfully, there are distributed VCS, which support several repositories for the project. This way, each developer can have her/his local repository (one or several), and work autonomously with each one. Such DVCS allows you to work even in conditions where you don’t have an Internet connection (for example, somewhere on a beach in Thailand.)
Git and Mercurial are the main contestants in the DVCS category, which are managed with the help of services such as GitHub, GitLab, or BitBucket.
Source code repository comparison
There are many public-hosted services as well as code repositories, including GitHub, GitLab, BitBucket, SourceForge, and others. They all have their strengths and weaknesses, and in this article, we’ll take a look at the most popular ones in detail.
GITHUB
Name: GitHub
Website: github.com
Manager: GitHub, Inc. (Acquired by Microsoft in 2018)
Established: 2004
Server-side: No
Client-side: No
Developed or used CDE: Unknown
Require free software on registration: No
Ad-free: Yes
Users: 40,000,000
Projects: 100,000,000
Available features:
- Code review
- Bug tracking
- Web hosting
- Wiki
- Personal repository
- Private repository
- Announce
- Build system: 3rd-party (e.g., Travis CI, Appveyor, etc.)
- Team
- Release binaries
- Self-hosting: GitHub Enterprise (Commercial)
Supported repositories:
- Git
- SVN (partial)
How to get FREE GitHub?
As of December 2021, GitHub offers a free plan for organizations and individuals. This free GitHub plan has the following features:
- Unlimited private/public repositories
- 2,000 automation minutes/month. (Valid only for public repositories. Private isn’t included.)
- 500 MB of package storage. (Valid only for public repositories. Private isn’t included.)
- New issues and projects in limited beta
- Community support
Git is a version control system while GitHub (and the like) is a cloud-based hosting service for managing Git repositories. You have Git repositories locally, and they are uploaded to the cloud-based GitHub.
Recently GitHub acquired the PullPanda service, which now simplifies the collaboration process on code reviews.
“Better code reviews mean better code for software teams of all sizes, whether you work in open source or on a Fortune 500 team,” says the press release from GitHub.
Check out the GitHub Octoverse report for 2020.
Frequently asked questions:
- How to get code from the GitHub repository? You can download the code as a ZIP archive and install it on your local computer with the help of Git.
- How to push code to the GitHub repository? You need to create a new repository on GitHub, and then change the current working directory to your local project. Initialize the directory with the help of $ git init. Add the files using $ git add. Finally, commit the files with the command $ git commit -m “My first commit
- How to add code to an existing GitHub repository? Find the repository’s main page on GitHub and click the button “Upload files.” You can drag and drop the files or folder you’d like to upload to your repository. Don’t forget to write a comment for the commit, so that other developers will understand what was changed.
- How to push code to the GitHub repository from Eclipse? Pushing code to the Git repository from Eclipse is easy. You need to create a local Git repository for your project in Eclipse. Right-click the project name in Project Explorer and click Team > Share Project > Git > Next > Create. Choose the folder for your local Git repository and click Finish.
- How much does GitHub cost? Single developer – FREE unlimited private repositories, Team – $4/user/month (with the user and team permissions management). Business – $21/user/month.
BITBUCKET
Name: Bitbucket
Website: bitbucket.org
Manager: Atlassian
Established: 2008
Server-side: No
Client-side: No
Developed or used CDE: Unknown
Require free software on registration: No
Ad-free: Yes
Additionally: not available in Cuba, Iran, North Korea, Sudan, and Syria.
Users: 5,000,000
Available features:
- Code review
- Bug tracking
- Web hosting
- Wiki
- Personal repository
- Private repository
- Build system
- Team
- Self-hosting: Bitbucket Server (Commercial. Previously known as Stash)
Supported repositories:
- Git
Atlassian has given us many useful projects, such as JIRA, Confluence, and BitBucket. The latter offers unlimited private code repositories for Mercurial and Git. At the moment, it is one of the most popular source code repository hosts, right after GitHub.
Among the features of BitBucket, you can find JIRA integration, custom domains, secured workflows and code reviews, as well as flexible deployment models for your code.
How much does it cost to use BitBucket? Small teams can enjoy it for free (up to 5 users). The standard plan (1-100 users) is $3/user/month, and the Premium plan costs $6/user/month. For more details on BitBucket pricing, check out their website.
GITLAB
Name: GitLab
Website: about.gitlab.com
Manager: GitLab Inc.
Established: 2011
Server-side: Partial
Client-side: Yes
Developed or used CDE:
GitLab Community Edition (CE) — free software
GitLab Enterprise Edition (EE) — proprietary
Require free software on registration: No
Ad-free: Yes
Additionally: not available in Crimea, Cuba, Iran, North Korea, Sudan, and Syria
Users: 100,000
Projects: 546,000
Available features:
- Code review
- Bug tracking
- Web hosting
- Wiki
- Personal repository
- Private repository
- Announce
- Build system
- Team
- Release binaries
- Self-hosting
- Can be installed on your server, allowing you to customize domains and access
- Provides Git repository management with issue tracking and code review
- Offers an Integrated Development Environment (IDE) with wiki and activity streams
- Has built-in continuous deployment and continuous integration, which allows you to build, test, and deploy code quickly.
Supported repositories:
- Git
GitLab is a complete DevOps platform with a CI/CD toolchain that works out of the box. GitLab can be installed on your server, which makes it a great option for those who are looking for a convenient source code repository hosting provider. We use GitLab for all our company projects, while the GitHub account was used for the open-source projects we were doing and contributing to.
How much does it cost to use GitLab? The community edition is free for an unlimited number of users. GitLab Premium package costs $19/user/month (or $228/year) and GitLab Ultimate is $99/user/month (or $1,188/year.) More on GitLab pricing is found on their website.
SOURCEFORGE
Name: SourceForge
Website: sourceforge.net
Manager: BizX LLC
Established: 1999
Server-side: Yes
Client-side: Apache Allura
Developed or used CDE: No
Require free software on registration: No
Ad-free: For open-source projects only.
Additional: not available in Cuba, Iran, North Korea, Sudan, Syria
Users: 3,700,000
Projects: 500,000
Available features:
- Code review
- Bug tracking
- Web hosting
- Wiki
- Shell server
- Mailing list
- Forum
- Personal repository
- Private repository
- Announce
- Team
- Release binaries
- Self-hosting
Supported repositories:
- Git
- Hg
- SVN
- Fossil
SourceForge was created to be an open-source community resource. Compared to the competitors, it has been around for 20 years now and is considered a top choice for developers who work with open-source projects. It is free to use SourceForge.
SourceForge features such tools as hosting code for Git, Subversion, and Mercurial. It also has a nice visualization for the commit history as a graph and features threaded discussion forums as well as integrated issue tracking.
Besides offering to host the project on the open-source platform, SourceForge also takes advantage of customer reviews and helps other businesses thrive. The pricing for the SourceForge promotion is steep, but from the list of features included, it’s worth it. There is a free plan available for those who place a SourceForge badge on their company website. Otherwise, the Plus plan starts at $450/month, the Premium plan is $975/month, and Amplify is $1,799/month.
OSDN
Name: OSDN (Previously known as SourceForgeJP)
Website: osdn.net
Manager: OSDN K.K.
Established: 2002
Server-side: Unknown
Client-side: Yes
Developed or used CDE: Unknown
Require free software on registration: No
Ad-free: No
Users: 54,826
Projects: 6,294
Available features:
- Code review
- Bug tracking is the main difference from SourceForge. In OSDN, bug tracking and wiki are more Trac-like systems.
- Web hosting
- Wiki
- Shell server
- Mailing list
- Forum
- Private repository
- Announce
- Team
- Release binaries
Supported repositories:
- CVS
- Git
- Hg
- SVN
- BZR
In terms of pricing, the OSDN website says that “each development project is provided with a free-of-charge shell server which can be used for testing software and structuring Web sites.”
APACHE SUBVERSION (SVN)
Name: Apache Subversion (Software Versioning & Revision Control System) Website: subversion.apache.org Manager: Apache Software Foundation Established: 2000
Available features:
- Files and entire directory trees would retain full revision history even if they were renamed, copied, moved, or deleted.
- Symbolic links keep the versioning
- Binary files are supported natively with space-efficient binary-diff storage
- Subversion offers native client-server and layered library design
- Open-source licensed with Apache Licence since version 1.7
- Has path-based authorization
- Supports merge tracking between branches, which allows automatic merging between branches
Frequently asked questions:
- What is the Subversion code repository? Often, the Subversion code repository goes by the name of SVN, which can cause confusion for new developers. Subversion and SVN are the same things.
- How much does Apache Subversion cost? It is free for use as it supports the open-source community.
- How to import source code from the SVN repository? Importing from a Subversion repository is simple – locate and select the folder into which your files should be imported in the repository browser, click File > Import in the menu, select the files to be imported, and click Import. Before committing, you can add an optional comment to log the action.
You might also be interested: Sharing Economy in Property Management
Tips & tricks: Factors to consider when choosing a code repository
We’ve taken a quick look at the most popular source code repositories and their management systems. It might seem like they are all the same, and it doesn’t matter which one to choose. However, there are five criteria you should pay attention to when you’re deciding on the project’s toolset.
- Supported version control systems. Is the repository hosting service compatible with the version control system used in the project? If you, for example, use SVN, but your hosting service doesn’t support it, you will have a hard time using it.
- Your team size. If your project involves only you, then you have a wide selection of options. However, when you have several developers involved, consider the level of permissions you need to assign and whether all your developers are working from the office or home/coworking spaces.
- Release schedule. How often do you plan to release the updates to the code? If you are planning to release small things regularly, then you can consider choosing a repository management system with continuous integration and deployment. These features will greatly simplify your daily routine.
- Your project size. Will you work with 3D graphics files or audio files? Are there any large file types involved? Some of the software solutions are specifically aimed at simplifying the working process for large files.
- Third-party solutions integration options. The chances are that you’ll need to integrate your source code repository with some other third-party solutions, for example, Atlassian’s JIRA or QA automation tools. These integrations help to streamline the working process and open a new variety of features that can empower your development experience.
At HUSPI, we prefer the combination of GitLab and GitHub. GitLab is used for internal projects that we work on for our clients. GitHub is used for contributing to the community of developers and generally working on various projects.
Book a call with our experts
Feel free to drop us a message regarding your project – we’re eagerly looking forward to hearing from you!