I'm a newbie to Git/GitHub.
Actually,I know how to create a new branch from the existing remote branch on GitHub by GitHub GUI Interface like below.
Creating and deleting branches within your repository
The CLI(Command Line) for this procedure is correct below?
git checkout -b new_branch_name origin/existing_branch_name_on_git_hub
Does anyone tell me a exact way?
It is correct, once you have:
Then a git branch -av
will show you all the branches including origin/existing_branch
.
And you can create a new branch with
git checkout -b new_branch_name origin/existing_branch_name_on_git_hub
But on the first push, do:
git push -u origin new_branch_name
That will add an upstream (tracking) reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With