title: Git rebase in developing with an iterative upstream
body: <p>Git <code>rebase</code> for me is a good way to get a linear history, but recently I got a little confused of its behavior. The situation is that I have my local repo, my origin repo on GitLab and the read-only upstream repo of my course.</p>
  <p>Basically TAs release documentations and codes in upstream repo, I fetch it and merge into my repo, and then finish the lab. It is an iterative process, for the lab2 is released after I finish lab1 and push it into origin. Things confusing happens in this iteration.</p>
  <p>After lab3 was released, I rebased <code>master</code> (which contains my code for lab1 and lab2) onto <code>upstream/master</code>, only to find that my commits were all gathered together at latest location of git history, like:</p>
  <p><strong>lab1-TA-release -&gt; lab2-TA-release -&gt; lab3-TA-release -&gt; lab1-my-code (with rebase time) -&gt; lab2-my-code (with rebase time)</strong></p>
  <p>I think it is commits time that shows the track of my work, so what I'd like to see is a linear history like:</p>
  <p><strong>lab1-TA-release -&gt; lab1-my-code -&gt; lab2-TA-release -&gt; lab2-my-code -&gt; lab3-TA-release</strong></p>
  <p>Is there any way to realize my wish?</p>
  <p>-----update-----</p>
  <p>For example, now I have finished lab2 and lab3 has been released on <code>upstream/master</code>. <code>lab3-TA-release</code> is not on my local master (so I cannot simply use <code>rebase</code> to resort my <code>master</code>). I need to <code>git rebase upstream/master</code> first. It is here that <code>my lab2-my-code</code> and <code>lab1-my-code</code> got gathered together and all refreshed with new time. So the real commit time (when I finished my work) disappear and I got confused.</p>
  <p>Is there any way to automatically reserve original time (means the real time) of commits and make it linear?</p>