title: git - what is the best practice for team work on a feature branch?
body: <p>We have the following branches:<br>
  <code>master</code> and <code>develop</code>.<br>
  We created a new branch <code>feature</code> off of <code>develop</code> and assigned a team to work on it.<br>
  During development:</p>
  
  <ul>
  <li>remote <code>develop</code> accepts new commits by other teams.</li>
  <li>remote <code>feature</code> accepts new commits pushed by the team members working on it.</li>
  </ul>
  
  <p>Sometimes there are hot fixes pushed to <code>develop</code> that need to be updated in <code>feature</code> as well.<br>
  Of course, at the end of the cycle, <code>feature</code> should be merged into <code>develop</code>.  </p>
  
  <p>We don't have a single workflow to keeping <code>feature</code> and it's local copies in sync with <code>develop</code>, and then making sure all local copies are based on the same commit.  </p>
  
  <p>My suggested workflow is as follows:  </p>
  
  <p><strong>Keeping up-to-date with <code>develop</code></strong></p>
  
  <ol>
  <li>New commits are pushed to <code>develop</code></li>
  <li><p>I rebase the <code>feature</code> branch:</p>
  
  <pre><code>git checkout feature
  git pull --rebase origin develop
  git push origin feature
  </code></pre></li>
  <li><p>All local <code>feature</code> copies run: <code>git pull --rebase origin feature</code></p></li>
  </ol>
  
  <p><strong>Updating the <code>feature</code> branch from local copies</strong></p>
  
  <ol>
  <li>A team member has finished his work on the <code>feature</code> branch</li>
  <li>He makes sure his local copy is up to date:  <code>git pull --rebase origin feature</code></li>
  <li><p>He merges his commits into <code>feature</code>:</p>
  
  <pre><code>git checkout feature
  git pull origin feature
  git merge local-feature
  git push origin feature
  </code></pre></li>
  </ol>
  
  <p><strong>Merging the <code>feature</code> branch into <code>develop</code></strong></p>
  
  <ol>
  <li><p>I make sure feature is up to date with <code>develop</code>:</p>
  
  <pre><code>git checkout feature
  git pull --rebase origin develop
  </code></pre></li>
  <li><p>I merge into <code>develop</code>:</p>
  
  <pre><code>git checkout develop
  git pull origin develop
  git merge feature
  git push origin develop
  </code></pre></li>
  </ol>
  
  <p>We do all that <code>pull --rebase</code> stuff in order to keep linear flow and make sure all our changes are merged using fast-forward.<br>
  However, as you can tell, there are a lot of commands to run every time.  </p>
  
  <p><strong>Is this really necessary? Are we doing it the "right" way?</strong><br>
  Would you suggest another flow?</p>