Nowadays, tools available within git hosting services like GitLab makes DevOps work so much simpler. Build-in monitoring, testing, deployment, and automatic code review are a secret to getting more done way faster. Are you ready to move from SVN or git to GitLab? Then by all means let us accompany you on this fantastic journey. Our first stop – an introduction to GitLab repositories.
GitLab repository – what exactly is it?
GitLab repository or in short repo is a place where developers keep their code available to the whole team and make all the changes. In a way, it’s where the code lives. And to make your work easier all pushed changes are tracked with version control. Every new GitLab project will contain a repository. As you probably figured out it’s quite similar to the way git works. And it is no wonder – GitLab is a self-hosted Git management software.
Where is the GitLab repository stored?
GitLab stores repositories in repository storage. It can be done in two ways. gitaly_address could become your repository storage. And because it points to the Gitaly node you get high-level RPC access to the code. It’s also possible to store your repos on a local machine – but it is not a recommended option.
How to create your first GitLab repository
GitLab has a really nice UX. You will find it out yourself pretty soon. But back to the topic. As you probably remember, every time you create a new project a repository is also automatically created. Furthermore, you can easily create a new project from the top bar: Menu > Project view. There is also a possibility to create a new repository during the fork operation.
How can you use GitLab on a daily basis?
What exactly can you gain by switching to GitLab? One of the best things is a true speed-up of all your development work. There are many useful tools and features provided by GitLab. First, you can trigger a GitLab CI/CD pipeline. This way you can deploy only a specific part of the repository. You can also cross-link issues and merge requests with ease. Of course, there is an option to cherry-pick a commit or – if you need it – revert it.
GitLab easily connects with the most popular code editors like Visual Studio Code or Sublime Text or if your team uses IDSs – then one of the JetBrains tools. Then you are able to clone the repository and open it directly on your device.
GitLab offers a project information page. It’s a neat feature that allows you to determine which programming language is used within your repository. It also displays all information related to your project, workflow – e.g. the number and size of files stored in your repo.
There is a possibility to check who worked on a project and what kind of changes that person made. You can verify this in two ways: there is something called a contributor graph available from the project’s Repository > Contributors. If you need more details about commits you could use a history graph instead. You can find it in the project’s Repository > Graph.
How secure is GitLab?
A quick question: are you using G Suite or Microsoft 365? Did you hear about the term shared responsibility model? It’s a standard policy used by many SaaS vendors. In short: as there is a user and a service provider, on each side rests different responsibilities to fulfill. Now, back to the GitLab. Its team is responsible for keeping the infrastructure safe and accessible. And they are doing a very good job. On the other hand, it’s the user’s responsibility to take care of the security of the data – code and all metadata. And how to do this exactly? By deploying a GitLab backup solution. Keep in mind that there are not many products on the market. When searching the Internet you will probably find many tips to use hand-made scripts. But be cautious. Scripts have to be manually maintained and it will cost you a lot of time to secure a GitLab ecosystem in that way. Did you use scripts to back up your computer? Better give a try to some of the professional third-party backup solutions. If you are not sure, there is always a free trial available. For instance, GitProtect.io allows you to test the solution for the whole 30 days. After just one month you will know how much time a professional backup will save you in the future.