git - How to start a new repo from a branch without losing a history of that branch and its child branches -
i have old , huge git repo. long time ago branch created has been acting main development branch since creation. other branches created implement features - taking branch root , merged branch a.
what start new git repository. new repository take creation of branch beginning (the beginning of history). abandon previous history.
i not git beginner since not standard git operation ask guys advice, ideas, useful links on how can achieve have described.
to keep question short: how start new repo branch without losing history of branch , child branches?
for each branch want it, create new branch shorter history. branch a
important one. use git checkout --orphan new_a <branching_point_sha>
create new branch has no history beyond branching point. delete old a
, , use git branch -m
rename new_a
a
per se. repeat relevant branches. delete irrelevant branches, well, because irrelevant , useless.
delete tags older branching point. it's clear don't need those.
now should have no references older part of history , can clean git gc
.
since not git beginner, must understand recalculate commit hashes etc. play safe.
Comments
Post a Comment