向分支提交一個初始的空commit,保證完全復位。
- 創建並切換新分支
git branch <new_branch>
git checkout <new_branch>
git rm --cached -r .
git clean -f -d
- 創建空的commit
git commit --allow-empty -m "[empty] initial commit"
- 推送新分支
git push origin <new_branch>
向分支提交一個初始的空commit,保證完全復位。
git branch <new_branch>
git checkout <new_branch>
git rm --cached -r .
git clean -f -d
git commit --allow-empty -m "[empty] initial commit"
git push origin <new_branch>
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。