i have a git repository that i created some time ago, and i made the mistake of putting all the files of my project in the root git repository path. However, i discovered that i want to version control some more elements that do not really belong to the root folder.
My current git is like :
git_repos/file1
git_repos/file2
...
I would like to convert that to :
git_repos/demo/file1
git_repos/demo/file2
git_repos/other_folder
git_repos/other_folder/file
You get the idea. I know i may be able to do it by moving files, but something tells me that there is probably a better way. Is there ? 🙂
The
git mvcommand is what you want to use. You can move more than one file at once by ensuring that the final destination name is a directory. For example:Don’t forget to commit the result when you’re done, of course.