How to push new local GIT Repository to GitLab


This tutorial explains the steps that need to be followed to push a new local GIT Repository to GitLab.

What is GitLab?

GitLab is a single application that spans the entire software development lifecycle. GitLab is an open-source project maintained by GitLab Inc with over 3,000 contributors. We can install and self-manage the GitLab Community Edition which is fully open-source under an MIT license. GitLab also provides an Enterprise Edition that has additional features built upon the open-source edition. 

GitLab’s application offers functionality to collaboratively plan, build, secure, and deploy software as a complete DevOps Platform.

Steps to follow:

Step 1 – Login to GitLab using your username and password.

Step 2 – In the dashboard, click the blue New project button. This opens the New project page.

Step 3 – Select Create a blank project.

Step 4 – A new page will open. Provide the following information on that page:

1. Project Name – Mention the name of your project in the Project name field – GitTest.

2. Project slug – When a name is added, the Project slug auto-populates. This is the URL path for your project that the GitLab instance uses.

3. Project description (optional)  – This field enables you to enter a description for your project’s dashboard, which helps others understand what your project is about.

4. Visibility Level – Select the appropriate Visibility Level for your project. I have selected private option.

5. I’m not checking ReadMe option as I already have a ReadMe file in my project.

Select the Create Project button.

We can see that a new empty project is created in the GitLab as shown below.

Step 5 – For every remote repo, you will get a unique URL as highlighted below. This URL is used to push the local changes to this remote repo. Type the below command in GitBash:

git remote add origin

To open GitBash, go to the location where the project is saved and Right Click and Select GitBash Here.

Add remote URL to local GIT Repository

git remote command provide the name to direct link to Repositories.

git remote command are used in conjunction with the git fetch, git push, and git pull commands.

git remote -v

This command list the remote connections we have to other repositories along with the URL of each connection.

Push the local changes to a remote repo

To push the changes from GIT Local Repository to GitLab in a particular branch of the remote repo, we need to use the below command:

git push <remote url or name> <branch name>

git push origin master

origin is the alias name of the full GIT Repository path (

Now run the Git push command as shown above. It will ask for your GitLab credentials in a new window as shown below. Please provide the username and password used to log in to GitLab.

Now we can see we have successfully pushed the local changes to the remote repository. Let’s go to GitLab and verify the latest changes. All the files from the local GIT Repository are moved to GitLab Remote Repository.

I hope this tutorial has helped you to set up a new project in GitLab and push the local changes to GIT Remote Repository.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s