title: Git workflow for merging remote ‘origin/develop’ into ‘origin/master’
body: <p>With unlimited lifetimes for ‘develop’ and ‘master’, what’s the best workflow for merging and tagging a GitHub remote ‘origin/develop’ branch into the remote ‘origin/master’ without the remote ‘master’ getting ahead of remote ‘develop’?</p>
  
  <p>Scenario for updating a file (readme) and tagging the ‘master’...</p>
  
  <p>Everything agrees...</p>
  
  <pre><code>$ git log develop ^master
  $ git log master ^develop
  $ git log master ^origin/master
  $ git log master ^origin/develop
  $ git log develop ^origin/develop
  $ git log develop ^origin/master
  </code></pre>
  
  <p>Switch to ‘develop’...</p>
  
  <pre><code>**$ git branch**
  * develop
    master
  </code></pre>
  
  <p>Edit README.md file.</p>
  
  <p>Commit to local repo...</p>
  
  <pre><code>**$ git commit -a**
  [develop 47c8393] Updated branching model
   1 file changed, 18 insertions(+), 6 deletions(-)
   rewrite README.md (81%)
  </code></pre>
  
  <p>Push ‘develop’ to remote ‘develop’...</p>
  
  <pre><code>**$ git push origin develop**
  Counting objects: 5, done.
  Delta compression using up to 2 threads.
  Compressing objects: 100% (3/3), done.
  Writing objects: 100% (3/3), 745 bytes, done.
  Total 3 (delta 1), reused 0 (delta 0)
  To git@github.com:xxx/xxx.git
     038cb2b..47c8393  develop -&gt; develop
  </code></pre>
  
  <p>Switch to ‘master’...</p>
  
  <pre><code>**$ git checkout master**
  Switched to branch 'master'
  </code></pre>
  
  <p>Merge ‘develop’ into ‘master’...</p>
  
  <pre><code>**$ git merge --no-ff develop**
  Merge made by the 'recursive' strategy.
   README.md | 18 +++++++++++++++---
   1 file changed, 15 insertions(+), 3 deletions(-)
  </code></pre>
  
  <p>Tag ‘master’...</p>
  
  <pre><code>**$ git tag -a v3.0.2**
  </code></pre>
  
  <p>Push ‘master’ to remote ‘master’...</p>
  
  <pre><code>**$ git push --tags origin master**
  Counting objects: 2, done.
  Delta compression using up to 2 threads.
  Compressing objects: 100% (2/2), done.
  Writing objects: 100% (2/2), 442 bytes, done.
  Total 2 (delta 0), reused 0 (delta 0)
  To git@github.com:xxx/xxx.git
     038cb2b..5750fa7  master -&gt; master
   * [new tag]         v3.0.2 -&gt; v3.0.2
  </code></pre>
  
  <p><strong>GitHub now reports remote ‘master’ is 1 ahead of remote ‘develop’ (the merge). Shouldn’t they agree?...</strong></p>
  
  <pre><code>**$ git log origin/master ^origin/develop**
  commit 5750fa78ff81f41ef2327c2f4595f98c0413e245
  Merge: 038cb2b 47c8393
  Author: 
  Date:   
  
  Merge branch 'develop'
  </code></pre>
  
  <p><strong>If the ‘master’ is merged back into ‘develop’, the HEAD points to ‘develop’, is this a problem? Should a new ‘develop’ be branched from the new ‘master’ (not supporting unlimited lifetime for ‘develop’)?</strong></p>