Skip to content

Branch from another Git branch

This will be needed when you want to start a development branch where the code is based on code that was committed in another branch and not the ‘Develop’ branch.

Aside: If you already created the new branch incorrectly you can delete it using git branch -D feature/name-of-branch

1. To see the list of currently checked out branches, and which branch you are currently in, use git branch. Ensure you are currently in the branch that you want to branch from.

2. To create the new branch use git checkout -b feature/name-of-new-branch.

3. Push the branch to remote using git push --set-upstream origin feature/name-of-new-branch.

Published inProgramming

Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *