Gitlab adding and removing of files

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 :)

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store