Feature branching in git

25 July 2021

Feature branching in git; creates branch myfeature from dev branch and retains myfeature branch after merging in:

# Check you're in dev
git branch

# Create branch from dev
git checkout -b myfeature dev

# Do work
git add -A
git commit -am "Commit msg"

# Now merge changes to dev w/o fast-forward
git checkout dev

# Can use git branch to check first
git branch
git merge —no-ff myfeature

# Push to remote repo
git push origin dev
git push origin myfeature