Have you ever heard this term uttered by some developer or read it online in some super technical article?!

Repository is a software that allows you to store a considerable amount of code and files by assigning them a unique number that identifies different versions of them. Imagine a large virtual central repository where you can digitally store your data with the ability to classify them by metadata, protect, process or duplicate them.

This is why repositories prove to be faithful allies of developers, precisely because they allow you to make and manage changes to an application’s source code while always retaining a copy of the previous version.

ragazza al computer utilizza i repository

How it works

Through the use of repositories, it is possible to work on the program code of a piece of software without compromising the code visible online, a kind of “copy.”

The main commands to keep in mind are:

  1. pull => retrieves the most recent version of the project;
  2. push => prepares the changes for submission;
  3. commit => sends a new version of the files;
  4. merge => combine different versions of the same file made by several people at different stages or if pull fails;
  5. deploy => upload changes to the server;
  6. stash => to save as a draft changes locally made and return to a clean working directory;
  7. clean => to remove any changes saved as a draft.

The project can be organized into multiple branches. Typically there is a development branch to handle new requests and features being tested, and a production branch for the public version of the project.

Team work

The repository also makes it easier to collaborate on the same project because you can simultaneously edit files remotely thanks to centralized information management.

This allows different developers, participating in the same project, to share their work, folders, text files, and other types of documents, with colleagues.

The various changes made to the code are tracked and monitored, throughout its development phase, from design to release.

An added value lies in the automatic comparison of previous and new files, with reports viewable before any new commit.

Bitbucket e Github

These are the two most widely used code repository services in the world, both platforms operating similarly to provide directories for both public and private files.

BITBUCKET
We begin by dealing with Bitbucket, a web-based version control repository service for Git written in Python, based on Atlassian’s cloud.

In recent times this platform has become quite popular mainly due to its flexible pricing structure that makes it unique.

In fact, Bitbucket, although it offers standard features, has the advantage of making unlimited private and public repositories available for free.

Holding the best value for money, it represents a cost-effective solution you should focus on if you are a professional or a business looking for a secure hosting service for developing your private and proprietary code, especially if you do not intend to make it public in its entirety.

GITHUB
We now come to talk about GitHub, the most popular development platform used by developers around the world. It is an open source repository service, written in Ruby and Erlang, that focuses on public code.

You can host and review code, develop software and ultimately manage your development projects. It provides unlimited free public repositories and is suitable for both personal and business development projects.

Being cloud-based, it allows developers to store and work on project codes in an efficient and organized manner.

Through its additional features aimed at improving collaboration among developers, you can participate in discussions by making your knowledge and expertise, within the framework of public projects on GitHub, available to your colleagues.

sviluppatore al computer modifica codice sorgente

Monorepo e Multirepo

How are codebases hosted and managed through Git?

Through two approaches:

  • Monorepo, uses a single repository to host all the code for the multiple libraries or services that make up a company’s projects or even the company’s entire codebase itself.
  • Multirepo, divides the code into units, it uses several independent repositories to host the multiple libraries or services of a project developed by a company.

The difference between the two is quite intuitive; if you choose to use the monorepo approach, members of different teams will have to move in unison making decisions together before putting them into practice. Otherwise with regard to multirepo the different teams will be able to move independently, making changes without the need to confront each other in advance.

With this article we hope to have clarified your ideas regarding Repositories and their use. Once you have identified the use you need to make of them, it only remains for you to choose the option that best suits you!