title: How to run a git command in python?
body: <p>The official manual in python 3.6 suggestes using subprocess instead of os.system,</p>
  
  <p>but I find sometime the subprocess do not work,</p>
  
  <p>like if I want to run a git command.</p>
  
  <pre><code>os.system("git add .") # This works
  gadd = subprocess.run(["git add ."]) # this shows a FileNotFoundError
  gadd = subprocess.run(["git", "add ."]) # this shows [git: 'add .' is not a git command.]
  </code></pre>
  
  <p>Well, how can I run this git command correctly in subprocess? I tried call(), it is just the same as run().</p>
  
  <p>I searched in google and stackoverflow, but almost all posts just say how to run 'ls -l'. Well ,that is easy, but this seems not.</p>