title: Run git commands from a C# function
body: <p>How can my C# code run git commands when it detects changes in tracked file? I am writing a VisualStudio/C# console project for this purpose. </p>
  
  <p>I am new to the the .NET environment and currently working on integrating automated GIT commits to a folder. I need to automatically commit any change/add/delete on a known folder and push that to a git remote. Any guidance appreciated. Thank you.</p>
  
  <p>Here is what I have and the last one is the one I need some guidance with:</p>
  
  <ol>
  <li>Git repository initially set up on folder with proper ignore file (done).</li>
  <li>I am using C# FileSystemWatcher to catch any changes on said folder (done).</li>
  <li>Once my project detects a change it needs to commit and push those changes (pending).</li>
  </ol>
  
  <p>Tentative commands the project needs to run: </p>
  
  <pre><code>git add -A
  git commit "explanations_of_changes"
  git push our_remote
  </code></pre>
  
  <p>NOTE: This code (with no user interaction) will be the only entity committing to this repo so I am not worried about conflicts and believe this flow will work.</p>