title: Git workflow to audit commits without rewriting history
body: <p>I am working with a developer that is new to git, and I would like to setup a git workflow that would let me auditing the commits made by this developer (and possibly reject them) without forcing him to rebase his work (which is error prone for new users).</p>
  <p>Here is the scenario :</p>
  <ul>
  <li>the <code>master</code> branch contains only audited code</li>
  <li><code>devel</code> branch is created by forking <code>master</code> branch</li>
  <li>a developer is working on the <code>devel</code> branch and push his code for me to audit</li>
  <li>I detect some issues with his code, so I ask him to make more commits on <code>devel</code> branch to fix the issue</li>
  <li>Once I'm happy with the code, I cherry-pick (or merge with squash) the developers commits on the <code>master</code> branch, add my own comments and mark the commit as authored by the developer</li>
  <li>The developer merge back the <code>master</code> branch into his <code>devel</code> branch</li>
  </ul>
  <p>Here is a visual illustration of this scenario :</p>
  <p><img src="https://i.stack.imgur.com/gYJS6.png" alt="Visual scenario" /></p>
  <p>After this sequence, how can I be <strong>100% sure</strong> that mistakes made by the developer during the &quot;make mistakes / redo&quot; sequence <strong>will not show up again</strong> when the developer will push his <code>devel</code> branch again after some other commits ?</p>
  <p>The best solution would be to ask the developer to rebase his <code>devel</code> branch against the <code>master</code> one, but this is a hard task to new git users.</p>
  <p>If this workflow is wrong in any way, please suggest me another where I would be able to audit the commits before merging them into the master branch.</p>
  <p><strong>EDIT</strong></p>
  <p>A friend suggested me a direction that looks promising : the <a href="http://git-scm.com/docs/git-commit#_options" rel="noreferrer">--fixup option</a> when doing commit.</p>
  <blockquote>
  <p><strong><code>--fixup=&lt;commit&gt;</code></strong></p>
  <p>Construct a commit message for use with <code>rebase --autosquash</code>. The commit message will be the subject line from the specified commit with a prefix of &quot;fixup! &quot;. See <a href="http://git-scm.com/docs/git-rebase.html" rel="noreferrer">git-rebase</a> for details.</p>
  </blockquote>
  <p>This option could be used by the developer to properly mark his second and third commits as a fix for his first one. A good solution to explore...</p>