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!
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 .
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With