How to Set Up A Git Repository within GitLab

What is a Git Repository?

What Is the Difference Between GitLab and GitHub?

How to Set up a Local Repository for GitLab

  1. Go to your dashboard and look for the green button labeled “New Project.” Alternatively, you can use the plus icon in the navigation bar. Either one of these buttons will open the “New Project” page.
  2. From the “New Project” page, you’ll be given the option to create a blank project, create a project from templates, import a project from a different repository, or run CI/CD pipelines for external repositories. See the sections below for further information on the specifics of each of these.

Creating a New Repository within GitLab

Blank projects

  1. Select “Blank Project” from the “New Project” page.
  2. Enter the name of your project in the “Project Name” field. Special characters aren’t allowed, but anything else is fair game.
  3. GitLab uses a project slug as the main URL path to your project. When you enter the project name, this “Project Slug” field will auto populate. If you don’t like the automatically chosen slug, you can change it manually.
  4. Entering a project description will help others understand what your project is about. This field isn’t required, but it is recommended to make project management easier. You can enter a description for your project in the “Project Description” field.
  5. Set the viewing and access rights for users in the “Visibility Level” section. This is where you decide which users will have access to which features. This is one of the distinguishing features between GitLab and more basic Git hosting services such as GitHub.
  6. Check the “Initialize repository with a README” option. This is an optional selection, but is recommended because doing so will put an initial file in the repository, create a default branch for it, and initialize the repository.
  7. Click on “Create Project” to finish the process.

Template-based projects

  1. From the “New Project” page, select the “Create from template” tab.
  2. If you want to use a built-in template, choose the “Built-in” tab from the page that opens. If you want to use a custom template, you can find them in the “Instance” or “Group” tab, depending on where the template resides.
  3. After selecting the type of template you want to use, you’ll be presented with a list of the available templates. Find a template that interests you and click on the “Preview” button to get a look at the template source.
  4. Once you’ve found the template that you want to use for your project, click on the “Use Template” button to begin creating a project based on that template.
  5. Now you must enter the details of the project. Everything from here on is exactly the same as the steps for creating a blank project, detailed in the section above.

Creating a Repository from an Existing Project

Cloning an Existing Repository

  1. To fork a project on GitLab, you need to have permission to view it. Assuming that you do, you can navigate to the project’s home page and click on the “Fork” button in the top right corner.
  2. Next, you’ll be shown a list of namespaces that you can fork to. You must have Developer or higher permissions for a namespace before you will be allowed to fork to it. After the fork is created, whichever permissions you have in the namespace are what you’ll have in the fork.

Conclusion

--

--

--

An Alten Company, Cprime is a global consulting firm helping transforming businesses get in sync.

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Building Quantum Information Systems using Cryptography

Windows CE SuperH3 Exploit Development Part 4: Buffer Overflows Take Two, Heap Spritzing, and…

How to truncate data in a Postgres database

Kill remote processes on job cancel

DevOps: Jenkins integration with GitHub using Webhooks and Pipelines to ensure CI/CD (Continuous…

Do it Agile: Thin Vertical Slices — Beginner Steps

If You’re Good At TikTok, You Will Be Very Good At Cloud Computing & Leveraging Serverless…

Quotes for Programmers

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Cprime

Cprime

An Alten Company, Cprime is a global consulting firm helping transforming businesses get in sync.

More from Medium

Pulumi Boot Camp Part 2

What are the benefits of DevOps?

How to (not) include Examples in your Documentation

Azure App Configuration for Mobile Apps

The Azure App Configuration service dialog; the text in the dialog says “Create an app configuration to manage application settings in a centralized manner.”