1

I have a bitbucket git repo repo1 containing (among other folders and subfolders) a subfolder repo1/path/to/mysubfolder. The architecture of mysubfolder is

\mysubfolder
    folder1
    ...
    foldern
    file1
    ...
    filep

and the path to mysubfolder contains spaces. I have an empty bitbucket git repo repo2. I would like to :

  • remove mysubfolder from repo1 (history include)
  • make mysubfolder contains be the contains of repo2, that is, that the architecture of repo2 be the same as the one of repo1
  • make repo2's history equal to mysubfolder's history.

A complication though : mysubfolder's history is huge and contain a small hundred of commits that concern mysubfolder but also files/folders not in mysubfolder'. (That is, does not only contain "pure" mysubfolder commits.)

Olórin
  • 3,367
  • 2
  • 22
  • 42

1 Answers1

0

You can try and have a look at the new git filter-repo, which will replace BFG and git filter-branch.

It does offer filtering/renaming options which would enable you to cleanup the history of your repository from a specific subfolder.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Given an "unpure" commit, is it possible to split it into a pure commit and a commit that does not concern `mysubfolder` ? – Olórin Oct 31 '19 at 09:14
  • @ujsgeyrr1f0d0d0r0h1h0j0j_juj The filter-repo script will operate on the content, so it will change a commit to rewrite it without mysubfolder, leaving it as "pure". – VonC Oct 31 '19 at 10:17