0

I cloned a branch "feature/first" Now I want to create a new one "feature/second" from "feature/first" and work with different things

my steps: 1. git clone [...] -b feature/first 2. ?

how can I do that?

  • 2
    I smell a confusion between cloning and branching *(third today if I'm not mistaken ^^)* – Romain Valeri Jan 17 '20 at 14:57
  • You can simply `checkout` the `"feature/first"` branch and then create the new branch with `git checkout -b "feature/second"`, have you tried that ? – Nizar Jan 17 '20 at 14:58
  • 1
    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 17 '20 at 15:18

1 Answers1

3

you can do the following actions:

  • git checkout feature/first to ensure to be on the "feature/first" branch;

  • git checkout -b "feature/second" to create a new branch named "feature/second" and switch on it.

Note: Pay attention on command... you clone a repository and then you can switch or create branch with git checkout command.

Zig Razor
  • 3,381
  • 2
  • 15
  • 35