Many times you want to create a new branch for a feature.
This is usually the case if you want to merge your current branch with the master
branch. The workflow is like this:
- Create new branch
- Commit changes
- Pull latest master
- Merge
This is how you do it in bash
/ git bash
.
# Create Branch and Switch to It
> git checkout -b branch_name
# Commit Changes
> ...
# Change Back to Master/Dev
> git checkout master
# Pull Latest Changes
> git pull
# Merge with Branch
> git merge branch_name