Gitlab adding and removing of files

Shivam Vatshayan
1 min readJul 19, 2022

--

Photo by Pankaj Patel on Unsplash

Here I am sharing step by step process to add and remove files on Gitlab.

Open the Project on Terminal

cdlscd Doc (Go to folder where is folder) else make folder mkdirlsll (List the name of files in folder)

Git commands

Adding files in Git

git branchgit checkout git checkout devgit branchgit statusgit addgit commitgit commit -m “added”git push

Here give your username and password to add files.

Your files are added to github repository

REMOVING FILES

Use git rm.

If you want to remove the file from the Git repository and the filesystem, use:

git rm file1.txt
git commit -m "remove file1.txt"

But if you want to remove the file only from the Git repository and not remove it from the filesystem, use:

git rm --cached file1.txt
git commit -m "remove file1.txt"

And to push changes to remote repo

git push origin branch_name

Thank you :)

--

--

Shivam Vatshayan

Blockchain Developer || Project Developer || Software Engineer