













August 25, 2024 | 1 分钟 | 149 字 | Tianlun Song | PR
要在当前仓库创建一个不包含任何文件的新分支,可以使用以下Git命令:
git switch
--orphan <new-branch-name>
git commit --allow-empty -m "Initial commit"
这两个命令的解释:
git switch --orphan <new-branch-name>:
git commit --allow-empty -m "Initial commit":
执行这些命令后,你将得到一个全新的、不包含任何文件的分支。
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。