In my remote repository I have:
Origin
feature
abc
20200801_branch_1
20200802_branch_2
.
.
abc
develop
I want to create a new branch feature/abc/20200811_mybranch with the data from feature/abc/develop. How can I do that??
Thanks!!
In my remote repository I have:
Origin
feature
abc
20200801_branch_1
20200802_branch_2
.
.
abc
develop
I want to create a new branch feature/abc/20200811_mybranch with the data from feature/abc/develop. How can I do that??
Thanks!!
Several methods (checkout -b
, branch
) achieve this simple action with nuances :
1) you currently have feature/abc/develop
checked out, you want to create your new branch but stay on feature/abc/develop
git branch feature/abc/20200811_mybranch
2) you currently have feature/abc/develop
checked out, you want to create your new branch AND check it out in the same move
git checkout -b feature/abc/20200811_mybranch
3) you have another branch (let's say abc
) checked out, you want to create your new branch from feature/abc/develop
but stay on your current branch
git branch feature/abc/20200811_mybranch feature/abc/develop
4) you have another branch (let's say abc
) checked out, you want to create your new branch from feature/abc/develop
AND check out the new branch immediately
git checkout -b feature/abc/20200811_mybranch feature/abc/develop