Sing's Log

Knowledge worth sharing


  • Home

  • Tags

  • Timeline

  • Portfolio

  • Search

Git - Create empty branch

Posted on 2017-06-25 | Edited on 2022-07-27 |

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

76 posts
189 tags
GitHub E-Mail Linkedin Facebook StackOverflow
© 2022 Sing Ming Chen
Powered by Hexo v3.9.0
|
Theme — NexT.Gemini v6.3.0