Git: merge branch into master, or master into branch : <p>I wonder if I'm making a mistake by first merging master into another branch, and then merging it back into master.</p>

<p>Suppose I create the following branches, each with a separate commit:</p>

<pre><code>            mkdir git_merging
            cd git_merging/
            git init
            touch on_master
            git add .
            git commit -m "Initial commit on master"

            git checkout -b x
            touch on_branch_x
            git add .
            git commit -m "Initial commit on branch x"

            git checkout master
            touch on_master_again
            git add .
            git commit -m "Commit on master after branching"
</code></pre>

<p>Now I want to merge. Usually, I prefer to first merge master into x, and then to merge x into master:</p>

<pre><code>            git checkout x
            git merge -m "Merge master into x" master 
            echo "test results"
            git checkout master 
            git merge x
</code></pre>

<p>That way I can test things before merging back into master, ensuring that I always have a functioning master branch. As far as I can tell, there are no functional differences, compared to merging x directly into master:</p>

<pre><code>            git merge -m "Merge x into master" x
            git checkout x 
            git merge master 
</code></pre>

<p>In practice, I often encounter repositories that seem to exclusively merge back into master however. Are there any drawbacks to my approach? Any reasons why I shouldn't be doing this?</p>
