GitLab Project Guide Step By Step!
Tags: beginners, tutorial, programming, opensource
Published: 2021-11-28 13:14:11

## You will need
Basic understanding of Git and git commands. There are a lot of resources about Git on the internet. [This book](https://git-scm.com/book/en/v2) is a good place to start.
Git installed on your local system. If you don’t have Git on your device yet, you can download it [here](https://git-scm.com/downloads).

## Step By Step Instructions
Making your first project on GitLab
## Step 1: 
Go to [GitLab website](https://gitlab.com/) and log in. If you don’t have an account yet, sign up with your credentials. Alternatively, you can sign in with Google, LinkedIn, and other third-party sites.

![img1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mou87887gao4b9xu7qea.jpg)

![Img2](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3rwkqf9hu3nnhup5g9bi.png)
 

## Step 2: Create a Project

![Img3](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8t9agajuhnob0b9dgy4p.jpg)

![Img4](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zs3tl1yn5ufxxb599a06.jpg)
Press “Create a project”, then “Create blank project”. Put in your project’s name (we use “Test”) and a slug (“test”). The slug will show up in the URL of your project on GitLab. Optionally, fill in a project description.
**Note:** By default, the visibility of your project is private. You can change it to “public” if your project is public-facing and the code doesn’t contain any sensitive data. We changed visibility from “Private” to “Public” in this example.

  
![Img5](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9t8k4zv3m3cd9jqtpzi1.png)

After completing these steps, your repository will open.Here you can see the “Test” repository is empty and has only a couple of default files: a README with basic user documentation and a GitLab yml file for continuous integration. Learn more about the yml file here.
 
![Img6](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6p1j9b2ad4me63eg7nvp.png)

## Step 3: Open git bash and configure git
Use the following commands for git configuration in your terminal or in Git Bash.
` git config --global user. name  <give username>`
`git config --global user.email <your email>`
**Note:** If you are not a new user and already have this configured you can skip this step.

![Img7](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/atbb9ybh7gavhb14v6dx.png)
 
## Step 4: Make a project folder/directory and initialize git

Make a directory/folder using the following command: `mkdir <your foldername>`
Open your newly created directory/folder with `cd  <folder name>`
Confirm the directory location with `pwd` or `ls`
Then initialize your git repository using  `git init`

![Img8](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7gozj0e36k0fc95v6nxx.png)

## Step 5: Make an example text file using the touch command
Here you can change your file according to your requirement.
Open your file on notepad using: `notepad <file name> `
As you type the `notepad <file name>` command, the notepad will open as shown below. Then you can update your notepad text file according to your requirements.

![Img9](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vzsqbyi6mgx4je2nfo25.png)

## Step 6: Check the status, add the file to staging and commit the changes.
Check the current status of your git repository: `git status` 
Then, add all changes in the current directory to the staging area: `git add .`
Commit the change: `git commit -m <commit message>`
![Img10](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/k4jxabgbb38ouqjkak91.png)

## Step 7: Push your local changes to the remote repository in GitLab
Now use the remote command, followed by the push command, to push the file to the remote repository.
Input and run the following subsequent commands in your terminal:
`git remote add origin <remote url>`
`git remote -v`

![Img11](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wi7i1ppe5lyra70j1zzm.png)
 
Now push the local repository to remote GitLab server by using `git push -u origin master/main`

As you write the push command, this window will pop up for authentication. Put in your GitLab credentials and continue.

![Img12](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/sn5bs2t1ngvk3m5kcsfj.png)

## Result:
All of your local changes will be checked into version control and reflected on your remote GitLab repository.

![Img13](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ipr7x60ear8ceobgdub.jpg)

*Congratulations, you upload your very first project on GitLab using version control*

## Thanks you reading, hope this guide helps!