Sing's Log

Knowledge worth sharing


  • Home

  • Tags

  • Timeline

  • Portfolio

  • Service

  • Search

Git - Create empty branch

Posted on 2017-06-25 | Edited on 2024-07-16 |

Sometimes I want to create empty branch for gh-pages or server-packages instead of branch from master, I will excute following command:

1
2
3
4
5
git checkout --orphan empty.branch.name
git rm --cached -r .
echo "init empty branch" > README.md
git add README.md
git commit -m "init empty branch"

Stackoverflow reference

# Git # cmd # branch
VSCode - Fix eslint autofix not work in .vue file
LeetCode - Average of Levels in Binary Tree
Sing Ming Chen

Sing Ming Chen

Sing's log, a developer's blog

90 posts
259 tags
GitHub E-Mail Linkedin Facebook
© 2024 Sing Ming Chen
Powered by Hexo v3.9.0
|
Theme — NexT.Gemini v6.3.0