其他分享
首页 > 其他分享> > git 创建一个新的空的branch

git 创建一个新的空的branch

作者:互联网

  1. Create an orphan branch
    git checkout --orphan mybranch

  2. Delete everything in the branch
    git rm -rf .

  3. Make some changes & commit
    touch test.txt
    git add test.txt
    git commit -m “Adding a test file”

  4. Push commits made on the local branch to the remote repository
    git push origin mybranch

标签:git,创建,orphan,branch,test,txt,mybranch
来源: https://blog.csdn.net/weixin_43632687/article/details/104795705