Git is a Distributed Version Control System (VCS)which is originally developed in 2005 by Linus Torvalds (Creator of Linux) and is open source, i.e. freely available to use. It is the most popular and most used version control tool right now. A staggering number of software projects rely on Git for version control, including commercial projects as well as open source.
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.
Create an empty repo in GitLab:
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 – SelectCreate 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 Projectbutton.
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:
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 fromthe local GIT Repositoryare 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.