Move folder to different repo - incl ALL history


I know there are quite some topics & tutorials out there on how to move a folder to a different repository… incl the history.

However, all the proposed solutions I encountered so far, seem to have difficulties with files that moved from elsewhere. 

The situation:


  • FOLDER1/foe
  • FOLDER2/

I want to move FOLDER1 to a new repo. When using methods like filter-branch, it indeeds keeps all history for ‘foe’… as long as the history was located in FOLDER1. 
Now, I have several items that moved from FOLDER2 to FOLDER1, having lots of history when it was in FOLDER2. The history for those items is always limited/chopped to FOLDER1, I can’t seem to transfer the history of ‘foe’ when it was still in FOLDER2…

Does anyone know if this is feasible? Seems strange that no one stumbled upon this before? I’m trying different approaches, currently trying to isolate FOLDER1 in a temp-repo & trying to clear the history of all orphan files that have nothing to do with the files in FOLDER1, no luck so far. 

Thanks in advance,


Currently investigating in how to use the patch-command to solve this, as it is a fair simple & fast way of moving around files.

I’m still stuck at the same issue though: rename history is skipped.

Current steps, based on

git log --pretty=email --patch-with-stat --reverse --full-index --binary – 9_Decommissioned > C:/java/projects/AMA_DECOM

- git am < C:/java/projects/AMA_DECOM

If I look at the generated file, the rename history isn’t present. I know you can see the rename history using ‘git log --follow’, however that doesn’t seem to work when preparing the patch…

Any ideas?

Thanks again,