#git switch to branch without merge on local repo

To switch from master to a branch or branch to another without merge.

git branch
*ma
ster

$ git fetch origin <new_branch>

$ git checkout
Branch legacy set up to track remote branch legacy from origin.
Switched to a new branch ‘new_branch'

$ git pull

$ git branch
* new_branch
master


Posted

in

,,

by

Comments

Leave a Reply

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