git replace
command can replace a commit with another commit, to be able to get a longer history. Suppose I have a long history of commits, and now I want to create a new repository with a new history. This will help so a new developer doesn’t have to download the complete history. However, if needed, I can load up the old history to the newer repo and get the full picture.
echo 'Get history from blah blah blah' | git commit-tree 9c68fdc^{tree}
The above command will take the entire tree up from 9c68fdc
and create a new parentless commit.