title: Use of git rebase in public feature branches
body: <p>You can see all over the web people advising to not use <code>git rebase</code> in a public branch, but I can't see what's the problem, if you always rebase a feature branch.</p>
  
  <p>My team always uses branches for features (wow), we are used to have it just locally, so rebase isn't a problem, but sometimes we wanna show the code of a partially done feature to another developer, so we just publicize it, but then we lose all of the advantages of <code>git rebase</code>, or at least that's what you can read at the web.</p>
  
  <p>I don't understand what's the problem, if the developers working at the same public branch never merge it to any branch (when there is still development on that branch) and when they pull it, they do it with a rebase operation. Any changes made to the branch will be always rebase on top of the remote branch, so never lost and you won't have the problem of having the same commit duplicated.</p>
  
  <h3>Append 1:</h3>
  
  <p>None of the answers until now showed the problems that will happen and how it will happen, so I will try to be clearer.</p>
  
  <p>I will give an example of a workflow using rebase (badly described in the previously paragraphs, sorry) that I don't see any problem.</p>
  
  <p>Initial state:</p>
  
  <pre><code>master         ==========A
  origin/feature           +=====AB
  feature user A           +=====AB
  feature user B           +=====AB
  </code></pre>
  
  <p>master get a few commits and user A does a few commits:</p>
  
  <pre><code>master         ==========A=====C
  origin/feature           +=====AB
  feature user A           +=====AB====D
  feature user B           +=====AB
  </code></pre>
  
  <p>User A does a <code>git pull --rebase</code> (he always does it) to update his branch, nothing new comes, then he rebase to master and push:</p>
  
  <pre><code>master         ==========A=====C
  origin/feature                 +=====ACB'=====ACB'D
  feature user A                 +=====ACB'=====ACB'D
  feature user B           +=====AB
  </code></pre>
  
  <p>(notice the B' is the new commits that still represents the changes B)</p>
  
  <p>Then user B does a few commits:</p>
  
  <pre><code>master         ==========A=====C
  origin/feature                 +=====ACB'=====ACB'D
  feature user A                 +=====ACB'=====ACB'D
  feature user B           +=====AB======E
  </code></pre>
  
  <p>User B finally does a <code>git pull --rebase</code> as always, there is no need to rebase on master, so he just pushes:</p>
  
  <pre><code>master         ==========A=====C
  origin/feature                 +=====ACB'=====ACB'D======E'
  feature user A                 +=====ACB'=====ACB'D
  feature user B                 +=====ACB'=====ACB'D======E'
  </code></pre>