Hello,
One of my repositories has grown a subdirectory that I'd like to split off, so other can use it as a subproject. With the help of google, I found this solution:
# first extract the library from the original repository
#
git clone --no-hardlinks repository library.tmp
(
cd library.tmp
git filter-branch --subdirectory-filter CF -- --all
git reset --hard
git gc --aggressive
git prune
git gc
git clone --bare . ../library
)
rm -rf library.tmp # Now remove the library from the original repository, so it can be
# included as a subproject
#
git clone --no-hardlinks repository repository.new.tmp
(
cd repository.new.tmp
git filter-branch \
--index-filter "git rm -r -f --cached --ignore-unmatch CF" \
-- --all
git reset --hard
git gc --aggressive
git prune
git gc
git clone --bare . ../repository.new
)
rm -rf repository.new.tmpThis works fine. But there's one problem, though. "gitk --all" in the new repository still shows all the history of the removed library. The patch show no modifications, but the log entry is still there.
Any hints how to get rid of those log entries?