1

Your current branch is master and if u create another branch like that git branch develop,then in branch develop you will have similar code about master。how can i get an empty branch.

Squonk
  • 48,331
  • 18
  • 101
  • 135
xulong
  • 49
  • 5

1 Answers1

1

You can create an orphan branch, which start without parent, and will be effectively "empty".

git checkout --orphan develop

This is since git 1.7.2: see "In git, is there a simple way of introducing an unrelated branch to a repository?".

Community
  • 1
  • 1
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755