I have started a project and already have some commits. I would like to change my approach, and commit everything on a clean slate. Is it possible to commit a work tree as an unconnected first commit directly, or do I really need to use a temporary remote for that?
Basically how I know I can do:
mkdir BOO
cd BOO
git init
... # create the first and maybe more commits...
cd ..
git remote add boo BOO
git fetch boo
git checkout -b boo/master new-master
git remote delete boo
rm -rf BOO/
Do I really need to use a temporary remote definition like above, or is there a way to directly create an unconnected starting commit?
(If it is not evident from the question, I would like to keep the original main branch still intact, at least for a while, for verification purposes (git diff
) and for cherry-picking.)