I have a parent repo which has almost 900 commits and I am creating child repo from it. I have tried almost all possible variations I know including using parent repo as template.
What I want to achieve is simillar to what repo template provides. I want to start with fresh repo with single commit. The problem arise when I pull from parent repo (it brings all 900 commits of parent repo in child repo's commit history). I also tried several variations for pulling template/upstream changes. Below is some of the commands I have used.
I have set template repo as
upstreamusinggit remote add upstream <template-repo-url>
git pull upstream main
git merge upstream/main
If I use template repo approach and pull from child, I get unrelated histoies error on first pull. But this brings all the 900 commits if I use --allow-unrealted-histories.
Finally, I want to know how can I create child repo from parent repo starting with single commit and get all the changes (commits) (I prefer using rebase as that will bring separate commits to child repo for details on what has been fixed).
Parent repo:
900 commits
--- (at this point I create child repo)
fixed(layout): navbar overlay
feat(demo): add code snippets
child repo:
single commit
--- (Above is all the commits of parent repo in single commit when I created child repo)
(now get all the commits separately)
fixed(layout): navbar overlay
(there might me child repo's own commits...)
feat(demo): add code snippets
I can also drop the idea of using templates If I can achieve above illustrated commits history.