I have a repo-a in github with many folders (f1, f2, f3). I want to create a new repo (repo-b) with f1, with all the branches.
Repo-a
 |_ f1
 |_ f2  ------+ 
 |_ f3        |
              |  Copy folder with branches and history 
Repo-b        |
 |_ f2  <-----+
This is what am i doing, but it only pushes one branch:
- clone the original repo - git clone https://github.com/myuser/repo-a 
- now remove everything but the folder i need - git filter-branch --prune-empty --subdirectory-filter f2 -- --all 
- then i change the remote origin to the new rep - git remote set-url origin https://github/myuser/repo-b 
- and finally i push everything - git push --all origin 
As i stated, when i check on repo-b it only contains one branch and not all of them.
Any ideas ??
Thanks.
 
     
    