Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to move files in Master branch to a folder in Master branch on Gitlab

I have some files and a folder in Master branch. I am wondering what are the commands to move those individual files from Master branch to the inside of the folder in Master branch.

Should I clone the Master branch from gitlab to my local first?

Thanks in advance!

like image 979
MAMS Avatar asked Oct 18 '25 15:10

MAMS


2 Answers

I guess you have cloned the repository locally, i.e. you did git clone [email protected]:sume-user/some-repo.git

Then you just need to move those files, commit and push those changes

git mv old/path new/path
git commit -m "Some commit message"
git push

git mv old/path new/path is just a short form for

mv old/path new/path
git add new/path
git rm old/path

or, in case you don't have other changes locally

mv old/path new/path
git add .
like image 81
Manuel Schmidt Avatar answered Oct 21 '25 05:10

Manuel Schmidt


If your GitLab web has the Web-IDE, you can use it to move folders without local clone. Click on Web-IDE on the repository main window.

Right click on the folder and select rename/move ( for example moving src to old/src)

Remember to commit changes

enter image description here

like image 42
Alireza Fattahi Avatar answered Oct 21 '25 03:10

Alireza Fattahi