-1

This is something crazy but I need some clarification.

I want to create two branches like a master with different alias.

Example :

branch one: master:master-1

branch two: master:master-2

I tried from terminal git checkout -b master:master-1

Getting fatal error fatal: master:master-1 is not a valid branch name.

Any idea to create branches like above.

Thanks.

abhimanyu
  • 524
  • 6
  • 14
  • Does this answer your question? [Create a branch in Git from another branch](https://stackoverflow.com/questions/4470523/create-a-branch-in-git-from-another-branch) – Chris Maes Jan 21 '20 at 13:41

2 Answers2

4

: is not a valid character in a branch name.

Check the documentation for git-check-ref-format

https://git-scm.com/docs/git-check-ref-format

Bert
  • 1,782
  • 14
  • 17
2

You're close the proper syntax. This will create and checkout master-1 at master's HEAD

git checkout -b master-1 master
EncryptedWatermelon
  • 3,042
  • 10
  • 26