Moving master head to a branch

branch, branching-and-merging, dvcs, git, version-control

Solution

A regular merge of G into master will do the trick, no need to rebase:

    feature1      C-D  
                 /
    master    A-B-E            
                   \                      
    feature2        F-G

git checkout master
git merge feature2

    feature1              C-D  
                         /
    master, feature2  A-B-E-F-G

Problem

I have several feature branches and a master branch. Feature2 is done. Normally I would rebase (working with a remote SVN repo and would like to keep the history, so no regular merge) and ff-merge. But since master hasnt changed since I branched, I would like to move the master head (at `E`) to `G`. Using `git branch -f master G` does not result in any visible changes, I assumed this is because `G` is on a different branch. Is it safe to use `git update-ref -f master G` here instead? Should I stick with rebase/ff-merge? Something even better? ``` feature1 C-D / master A-B-E \ feature2 F-G ``` Thank you.

Original source