Create a Git Branch From Another Branch

preview_player
Показать описание
Here's a quick example of how to create a Git branch from another branch in your Git repository.

Normally a developer will create a Git branch based off the branch they are currently on. Other times, the new branch will be based off another existing Git branch. This quick tutorial shows you how to do both and contrasts the two git branch creation approaches against each other.

The spoiler?

git branch new-branch-name the-other-branch-name

That's it. That's how you create a Git branch from another branch in the repository.
Рекомендации по теме
Комментарии
Автор

I found this very concise and to the point, which I very much appreciate. Thank you.

DLang-hizx
Автор

Super concise and helpful. Thank you!

transcendcapitalism
Автор

That's a local branch, right? How about the remote branch? will it be created at a push?

lvasiescu
Автор

Is it bad to create a branch from another branch? Let's say I create a branch off an existing branch. What happens to my branch if the original branch is merged? What happens to my branch of a branch?

EdwardSileo