## Git创建空白分支
#### 在Git中创建一个空白分支,你可以使用以下命令:
```bash
git checkout --orphan new_branch_name
```
这将创建一个没有任何提交历史的新分支new_branch_name。接下来,你可能需要添加一个文件,提交它,然后推送到远程仓库:
```bash
# 添加一个文件作为起点
echo "Initial commit" > initial_commit.txt
# 添加文件到暂存区
git add initial_commit.txt
# 提交改动
git commit -m "Initial commit on new branch"
# 推送新分支到远程仓库
git push -u origin new_branch_name
```
发表评论 取消回复