GIT rebase

git checkout feature-branch
git checkout -b master-rebase
git rebase -i master

(pick the first commit and squash the rest of the commits)

during merge conflicts:
git checkout --theirs .
git add .
git rebase --continue

ff merge:
git checkout master
git merge master-rebase

cleanup:
git branch -D master-rebase

----------------------------
.. to overwrite current branch1 with branch2

git checkout branch2
git merge -s ours branch1

.. this effectively makes branch1 = branch2

.. now to fast forward branch1 to sync the branches

git checkout branch1
git merge branch2

No comments: