I have the following repository foo.git
with the following sub-folders.
/foo
----/bar1
----/bar2
I want to create a new separate repository bar1.git
along with its commit history, with two copies of the contents now - at bar1.git
and foo.git/bar1
.
Also, what would be a good way to merge back the updated contents of bar1.git
with foo.git/bar1
at a later point of time with the new commit history retained?
I am aware of subtree
, submodule
and filter-branch
commands but not sure which one and how exactly to use them in my case.