update master branch github code example
Example 1: Update master to main github
git branch -m master main
git fetch origin
git branch -u origin/main main
git remote set-head origin -a
Example 2: update branch with master
MERGE METHOD: (keeps branch history accurate)
git checkout b1
git merge origin/master
git push origin b1
REBASE METHOD: (history will appear linear, will conflict if already pushed)
git checkout b1
git rebase master