Home Blogs Programming What Code Repository to C ...

What Code Repository to Choose for Your Project

“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 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 personal project?” 

What do you call a code repository?

If you are a developer, you’ve definitely heard the name GitHub or BitBucket at least once - these are an example of code hosting service platforms. 

A source-code repository is an archive with the code as well as the hosting facility for these software archives, where you can also have the project’s technical documentation, web pages, snippets, patches, etc. which can be accessed publicly (open-source) or privately. 

What can source code repository do? 

  • Keeps your code safe
  • Offers version control option to make sure all changes that were done to your code are tracked, and you know who did something to your code. You can also revert back to the previous version of the code before “Everything went bad.”
  • Simplifies the process of unifying changes from developers’ collaboration
  • Provides and promotes teamwork principles since several developers can work together on the same projects, modules, and even code lines
  • Prepares your code for release to production
  • Keep the statistics and analytics of the changes in the code

What is the purpose of a code repository? We think there are three major ones:

  • 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, GitHub repository or commits to an open-source project are the best CV 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 for 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 a 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, is not relying on the original repository and will remain if the source was deleted. It becomes its own 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.

comparison of the top code repository managers according to google as of november 20, 2019

[Comparison of the top repository managers according to Google as of November 20, 2019]

Why do we need a code repository?

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 uploaded 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, repeat the previous steps… Too long.

With a 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, the repository management solutions (also known as Version Control Systems or VCS) have many other useful features:

  1. You can work on the same project wherever you are without relying on your local storage for the project.
  2. You can collaborate with numerous other developers on a company product or contribute to the 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.)
  3. 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. 
  4. You can revert to the previous version (or find out who broke the code or fixed a critical bug.)

Distributed Centralized Decentralized Communications

[Source: On Distributed Communications]

Advantages of Distributed Version Control Systems

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 own local repository (one or several), and work autonomously with each one. Such DVCS allows you to work even in conditions when 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. 

Centralized vs Distributed Version Control Systems

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 Octocat Logo

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)

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 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 2019.

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 GitHub repository? You need to create a new repository on GitHub, 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 commit, so that other developers will understand what was changed. 
  • How to push code to GitHub repository from Eclipse? Pushing code to 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 (new feature of 2019), $7 monthly for unlimited public repositories, and unlimited collaborators. Team - $9/user/month (with the user and team permissions management). Business - $21/user/month. 

BitBucket Logo

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). Large teams pay $1/user/month ($10 for 10 users, $25 for 25 users). If you have a large development company or IT department, you can opt for the unlimited users' plan, which costs $200/month. 

GitLab logo

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 own server, allowing you to customize domains and accesses
  • 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 CI/CD toolchain that works out-of-the-box. GitLab can be installed on your own 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. Enterprise Editions have two options: Starter is $3.25/user/month (or $39/year) and Premium for $16.59/user/month (or $199/year)

SourceForge Logo

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.

OSDN logo

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 - the main difference from the 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

Subversion SVN Logo

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. 

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.

  1. 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. 
  2. 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. 
  3. 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. 
  4. 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.
  5. 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. 

You may also like