我已经开始了一个项目并且已经有一些提交。我想改变我的方法,把所有事情都放在一个干净的地方。是否可以直接将工作树作为未连接的第一次提交提交,还是我真的需要为此使用临时遥控器?
基本上我知道我能做什么:
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/
我真的需要像上面那样使用临时远程定义,还是有办法直接创建未连接的开始提交?
(如果从问题中看不出来,我想至少在一段时间内保持原始主分支完好无损,以进行验证(git diff
)和挑选樱桃。)