title: Rebase local repo with remote whose history has changed
body: <p>Following this <a href="http://stevelorek.com/how-to-shrink-a-git-repository.html" rel="nofollow noreferrer">guide</a>, I shrank our project repository by deleting some heavy files that are in history. This means that the git history has changed. But the problem now is how my other team members can't get the new shrank version of our repo without losing the changes they've made on branches not currently on remote and also without pushing back the deleted history.</p>
  
  <p>The author suggested clone or rebase:</p>
  
  <blockquote>
    <p>Anyone else with a local clone of the repository will need to either use git rebase, or create a fresh clone...</p>
  </blockquote>
  
  <p>A fresh clone would mean discarding all the changes any team member did locally. Therefore, rebase seems like the better option. But how can we go about it?</p>
  
  <p>I was thinking of something like this: (assuming master is the base branch of the new-feature branch, the local branch on developer machine with new work on it, and master had been affected by the history rewrite):</p>
  
  <pre><code>$ git checkout master
  $ git fetch origin
  $ git pull --rebase
  $ git checkout new-feature
  $ git rebase master
  </code></pre>
  
  <p>confirm all work well then</p>
  
  <pre><code>$ git push origin
  </code></pre>