DEV Community

Boomika N
Boomika N

Posted on • Edited on

My First Step in Learning Git and GitLab

What is Git?
Git is a distributed version control system.
It helps developers:

  • Track Changes in code
  • Save different versions of projects
  • Go back to previous versions if something goes wrong.

Git has Two Main Types

  1. Centralized Version Control System (CVCS)
  2. There is one Central server
  3. All developers connect to that one server
  4. If the server crashes work can be lost
    In this system everyone depends on one main system.

  5. Distributed Version Control System (DVCS)

  6. Every developer has a full copy of the repository

  7. You can work offline

  8. If one system fails others still have full copy

  9. Git is a Distribution version control system
    This makes Git faster and safer.

Why Git is important to Learn?
Git is important to learn because it is widely used in the software industry. it helps developers track changes,collaborate in teams, and manage project versions efficiently knowing Git is essential for becoming a professional developer.

How I Installed Git in Linux
I installed Git on Linux using the terminal .First , i updated the package list using[sudo apt update],then installed Git with [sudo apt install git].Finally i verified the installation using [git--version].

What is GitLab?
GitLab is a web-based platform that helps developers store,manage and collaborate on Git repositories. it allows teams to work together and keep their code safe online.

How to create an account in GitLab
I created my account in Gitlab by visiting the offical website and clicking on the register button. I signed up using my email address and created a username and password. After completing the registration form,i verified my email address through the confirmation link sent to my inbox. once the verification was completed ,i finished setting up my profile, after that my Gitlab account was ready to use.

How to create a project in Gitlab
After creating my account in gitlab I logged in and clicked on the "New Project"button on the dashboard. Then i selected the option "create blank project". I entered a project name, chose the visibility level (public or private)and clicked on "create project".from the gitlab website and copied the repository URL,then in my local project folder,i initialized Git using[git init], added the remote repository using[git remote add origin and pulled existing changes using [git pull origin main]. After that,i staged my files with[git add .], committed them using [git commit -m "inital commit"],and finally pushed the project to Gitlab using [git push -u origin main].

How to clone a project in GitLab
To clone a project from GitLab ,i first navigated to the desired folder using the cd command . Then i used [git clone ] to download the repository to my local system . This command automatically initialized git and connected the project to the remote repository ,after cloning , I entered the project directory using[cd projectname].

Top comments (0)