git-filter-repo
git-filter-repo copied to clipboard
It's possible to rename an inner directory when performing filter-repo
Hello, I have to say that I'm a simple git user and have no advanced experience.... what I've been asked is to move an imported set of git repo (migrated from VSS) to a new one, performing a rename of an inner directory...
Filter repo works great till I do
git filter-repo --force --subdirectory-filter MyTopLevFolder git mv Dir1 Dir2
at this point I should do a commit, but doing so in the history I've just my commit message specified with commit -m "Text"
When I clone the repo I've the project in the form MyTopLevelFolder\Dir1
I wish it to be just Dir2 keeping the repo's history
Is it possible? How? Thanks
I don't understand the setup. What's the git mv Dir1 Dir2 portion of your command attempting to do. Was that meant to be on a different line?
What directories are you starting with? What do you want to end with? It's not clear to me if you have toplevel directories MyTopLevFolder, MyTopLevelFolder, Dir1, Dir2, and maybe others? Or are Dir1 and Dir2 just things under MyTopLevelFolder? Or is that were you want it to end up? What is being renamed, what is being filtered out?
I suspect we can give you the commands you need, but I need to understand what you want to do first.
Hello, Sorry for my delay and happy new year! I try to explain better what's my starting situation. After the migration from VSS I've got a series of repositories that are in the current form . I'll call MyTopLevFolder ProjectAlfa which is an alias for the name of the project.
So after the migration I've got a series of repositories that are in the form
Bin7/ProjectAlfa/Bin sources/ProjectAlfa/sources images/ProjectAlfa/images runtimes/ProjectAlta/runtimes
and so on.
So the idea is to have just a Project alfa repository on the toplevel in the and then the repositories with the history in the form
ProjectAlfa/images ProjectAlfa/runtimes
To complicate things the Bin7 and sources folder should fall in
ProjectAlfa/bin
and right now it's what is causing me more issues... since if I do just from inside the Bin7
git filter-repo --force --subdirectory-filter ProjectAlfa
I've got the ProjectAlfa to disappear and the Bin7 with all the history. (when I perform the merge on the new ProjectAlfa repo)
If I perform the git mv Bin7 bin as I need, at this point I should do a commit to have modifications to appear on the merge. But at this point, only the Commit comment appears as history for the files.
Otherwise, if I don't perform the mv command, I've got the history on the files, but the Bin7 folder instead of bin.
I hope I've explained it better
Thanks Paolo