• Categories
    Category
  • Categories
    Category
  • News
  • Tutorials
  • Forums
  • Tags
  • Users
Tutorial Comments FAQ Related Articles

How to add local folder to a GitLab project

1409

How to add local folder to a GitLab project

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.

Configuration procedure

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.

GitLab

[user1@localhost git]$ git remote add origin git@192.168.7.212: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 < user1@localhost.localdomain> 
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 git@192.168.7.212: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.

Tags:
elijah
Author: 

Comments ( 2 )

linuxhelp
To add a different folders on Gitlab using different branches.

For example ,I do have branches named test1 test2

First convert the branch from master branch to test1 branch
'git checkout test1'
From test1 branch, I am pushing the data to the origin

git add .

git commit -m "test1 Commit"

git push origin test1

Now again change the branch from test1 to test2 using the git checkout and follow the same procedures where while pushing the origin,change the tes1 as test2
angelaveselinova
how to add a few folders on gitlab in a different branches?
Add a comment

Frequently asked questions ( 5 )

Q

how to Add the new gitlab remote to your existing repository and push ?

A

To Add the new gitlab remote to your existing repository and push use the following command #git remote add gitlab url-to-gitlab-repo
#git push gitlab master

Q

How to remove a directory from git repository?

A

To remove a directory from git repository run the following command
git rm -r one-of-the-directories
git commit -m "Remove duplicated directory"
git push origin (typically 'master', but not always)

Q

How to start the git from terminal ?

A

Run the Git init command to initialize Git repository in the target system.

git init

Q

What is the command to commit a git?

A

Run the Git commit command to list the files that has to be pushed.

git commit -m ' 1st commit'

Q

how to push the Files in git?

A

To push the Files in git use the following command

git push -u origin master

Related Tutorials in How to add local folder to a GitLab project

Related Tutorials in How to add local folder to a GitLab project

How to add local folder to a GitLab project
How to add local folder to a GitLab project
Apr 20, 2017
How to reset gitlab admin password
How to reset gitlab admin password
Mar 30, 2017
How to Install and configure GitLab runner on centos 7
How to Install and configure GitLab runner on centos 7
Oct 22, 2021
How to change default backup location in GitLab
How to change default backup location in GitLab
Apr 17, 2017
How to add users to group in GitLab
How to add users to group in GitLab
Feb 15, 2017
How to Change the Administrator Password in GitLab-CE on CentOS 7.6
How to Change the Administrator Password in GitLab-CE on CentOS 7.6
Aug 3, 2019
How to add SSH key to a GitLab account
How to add SSH key to a GitLab account
Apr 22, 2017
How to Create Description Templates for Gitlab Projects
How to Create Description Templates for Gitlab Projects
Mar 28, 2017

Related Forums in How to add local folder to a GitLab project

Related Forums in How to add local folder to a GitLab project

gitlab
baseer class=
How to check gitlab version
Oct 24, 2017
Git
vertonskjelvic class=
error: failed to push some refs to in gitlab
Nov 24, 2017
gitlab
caden class=
Insufficient space in download directory /var/cache/yum/x86_64/6/base/packages
Jul 22, 2019
gitlab
brayden class=
GitLab: The project you were looking for could not be found
May 23, 2017
gitlab
ceriaimmaculate class=
Gitlab : how to rename branch name
Oct 26, 2017
gitlab
otwol class=
502 Error Whoops Gitlab is Taking too much of time to respond
Jul 29, 2019
gitlab
ajinfernando class=
Gitlab : how to switch remote repository URL from ssh to http
Oct 25, 2017
gitlab
otwol class=
How to Check the version of Gitlab-CE 12.0.3 On CentOS 7.6 and Where is it exactly Located
Jul 23, 2019

Related News in How to add local folder to a GitLab project

Related News in How to add local folder to a GitLab project

Gitlab assures its users of data recovery post data loss incident
Gitlab assures its users of data recovery post data loss incident
Feb 4, 2017
Back To Top!
Rank
User
Points

Top Contributers

userNamenaveelansari
135850

Top Contributers

userNameayanbhatti
92510

Top Contributers

userNamehamzaahmed
32150

Top Contributers

1
userNamelinuxhelp
31040

Top Contributers

userNamemuhammadali
24500
Can you help Luk Van De Looverbosch ?
How to create a root ?

Hello,
How to create root@linuxhelp in Linux Mint 20.1 64-bit ?
Thanks in advance for your reply.
Best regards.

Networking
  • Routing
  • trunk
  • Netmask
  • Packet Capture
  • domain
  • HTTP Proxy
Server Setup
  • NFS
  • KVM
  • Memory
  • Sendmail
  • WebDAV
  • LXC
Shell Commands
  • Cloud commander
  • Command line archive tools
  • last command
  • Shell
  • terminal
  • Throttle
Desktop Application
  • Linux app
  • Pithos
  • Retrospect
  • Scribe
  • TortoiseHg
  • 4Images
Monitoring Tool
  • Monit
  • Apache Server Monitoring
  • EtherApe 
  • Arpwatch Tool
  • Auditd
  • Barman
Web Application
  • Nutch
  • Amazon VPC
  • FarmWarDeployer
  • Rukovoditel
  • Mirror site
  • Chef
Contact Us | Terms of Use| Privacy Policy| Disclaimer
© 2025 LinuxHelp.com All rights reserved. Linux™ is the registered trademark of Linus Torvalds. This site is not affiliated with linus torvalds in any way.