GitLab is an open source application used to code, test and deploy code together. It provides the Git repository management with access controls, code reviews, issue tracking and activity feeds. This tutorial will explain about the process of adding local folder to a GitLab project.
To start the configuration procedure, first move to the local folder of the Git using the cd command.
[user1@localhost Desktop]$ cd git/
Run the Git init command to initialize Git repository in the target system.
[user1@localhost git]$ git init Initialized empty Git repository in /home/user1/Desktop/git/.git/
Add the project path in which the local folder is to be copied and execute the command.
[user1@localhost git]$ git remote add origin email@example.com:user1/sample-project.git
Now add the files to the list which has to be tracked. To add the whole files give “.”
[user1@localhost git]$ git add .
Run the Git commit command to list the files that has to be pushed.
[user1@localhost git]$ git commit -m '1st commit' [master (root-commit) c2bf8c4] 1st commit Committer: user1 <firstname.lastname@example.org> Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly: . . . create mode 100755 public_html/test-svgs/flag.svg create mode 100755 public_html/test-svgs/github.svg create mode 100755 public_html/test-svgs/save.svg create mode 100755 public_html/test-svgs/svgo-logo.svg create mode 100755 public_html/test-svgs/tiger.svg
Now execute the following command to push the files to the project.
[user1@localhost git]$ git push -u origin master Counting objects: 213, done. Compressing objects: 100% (197/197), done. Writing objects: 100% (213/213), 717.83 KiB, done. Total 213 (delta 19), reused 0 (delta 0) remote: Resolving deltas: 100% (19/19), done. To email@example.com:user1/sample-project.git * [new branch] master -> master Branch master set up to track remote branch master from origin.
Wasn't that an easy configuration procedure? Now adding local folder to a GitLab project is easy.
Thank you! for using Linux Help.
You find this tutorial helpful? Share with your friends to keep it alive.
For more help topics browse our website www.linuxhelp.com
Be the first to comment, we value your suggestions. For further queries please comment below.