title: Using GIT_SSH_COMMAND with GitPython
body: <p>I'm using GitPython to initialize a new local repository, create the initial commit and push to a canonical repository. Unfortunately, the last step is failing and I'm having a lot of trouble understanding why. I'm sure I'm just using the <code>GIT_SSH_COMMAND</code> variable wrong, but I'm not sure how. There aren't many examples out there to go on.</p>
  
  <p>I've read <a href="https://stackoverflow.com/questions/28291909/gitpython-and-ssh-keys/28292493?noredirect=1#comment45884023_28292493">this SO question</a> and dug into the relevant <a href="https://github.com/gitpython-developers/GitPython/pull/256" rel="nofollow noreferrer">issue</a> and <a href="https://github.com/teeberg/GitPython/commit/158bc981130bfbe214190cac19da228d1f321fe1" rel="nofollow noreferrer">commit</a>, but I clearly haven't managed put it together correctly.</p>
  
  <p>Help?</p>
  
  <p><strong>"Proof" of Git v2.3+</strong></p>
  
  <pre><code>$ git --version                                                                                                                          
  git version 2.3.1
  </code></pre>
  
  <p><strong>Script Snippet</strong></p>
  
  <pre><code># Please take my word that I've init'd the repo and that any variables
  # have been defined and initialized.
  git_ssh_identity_file = os.path.expanduser('~/.ssh/id_rsa')
  git_ssh_cmd = 'ssh -i %s' % git_ssh_identity_file
  with git_project.git.custom_environment(GIT_SSH_COMMAND=git_ssh_cmd):
      git_project.remotes.origin.push(git_project.heads.master)
  </code></pre>
  
  <p><strong>Resulting Error</strong></p>
  
  <pre><code>Traceback (most recent call last):
    File "./ct-new-project.py", line 204, in &lt;module&gt;
      git_project.remotes.origin.push(git_project.heads.master)
    File "/Library/Python/2.7/site-packages/git/remote.py", line 667, in push
      return self._get_push_info(proc, progress or RemoteProgress())
    File "/Library/Python/2.7/site-packages/git/remote.py", line 588, in _get_push_info
      handle_process_output(proc, stdout_handler, progress_handler, finalize_process)
    File "/Library/Python/2.7/site-packages/git/cmd.py", line 202, in handle_process_output
      return finalizer(process)
    File "/Library/Python/2.7/site-packages/git/util.py", line 158, in finalize_process
      proc.wait()
    File "/Library/Python/2.7/site-packages/git/cmd.py", line 300, in wait
      raise GitCommandError(self.args, status, self.proc.stderr.read())
  git.exc.GitCommandError: 'git push --porcelain origin master' returned with exit code 128
  </code></pre>