Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git create a empty branch from existing repository

Tags:

git

branch

I have a git repository which has many branches my requirement is to create a new empty branch so that its independent of the earlier branches.

like image 660
Brajesh Pant Avatar asked Sep 14 '15 07:09

Brajesh Pant


1 Answers

That's not a good practice, but if you want really start with a new branch without relation to master you must use --orphan argument of checkout :

git checkout --orphan version2
# and remove your project files

You'll get more detail about --orphan arguments in the doc : http://git-scm.com/docs/git-checkout

like image 148
Samuel Dauzon Avatar answered Sep 18 '22 13:09

Samuel Dauzon