How to create a new branch from master in git
To create a new branch from the master branch in Git, you can use the following command:
git branch <branch-name>
Replace <branch-name>
with the name you want to give to your new branch.
For example, if you want to create a new branch called "feature/new-login-system", you would run:
git branch feature/new-login-system
This will create a new branch called "feature/new-login-system" that is based on the current master branch.
If you want to switch to the new branch immediately after creating it, you can use the following command:
git checkout -b <branch-name>
This will create a new branch and switch to it in one step. For example:
git checkout -b feature/new-login-system
This will create a new branch called "feature/new-login-system" and switch to it.
Note: If you want to create a new branch from a specific commit, you can use the following command:
git branch <branch-name> <commit-hash>
Replace <commit-hash>
with the hash of the commit you want to base your new branch on. For example:
git branch feature/new-login-system 123456
This will create a new branch called "feature/new-login-system" based on the commit with the hash "123456".