title: How would I send a file's contents to update an existing Github Gist via Git bash?
body: <p>I'm trying to remotely update an existing Github gist through Git bash, and I cannot find a way to upload a file's contents without manually declaring the contents inside of the command.</p>
  <p>My goal is to take a file I have on my PC, and upload its contents to update a pre-existing Gist (the Gist ID which is mentioned in the latter text).</p>
  <p>Here is an example Gist ID in the hope that it helps: 'c7alSToGZjxiMveTa2e6bzVvXJRqS09D'. For the sake of this discussion, the exact name of the file I am trying to upload is 'testingFile.txt', located at the file path 'C:\Users\username\Desktop', with the Gist file display name of 'monkey.txt'.</p>
  <p>How would I make the &quot;curl PATCH&quot; command be able to execute such an upload/update procedure? I've tried the following code <code>curl -d '{&quot;files&quot;:{&quot;monkey.txt&quot;:{&quot;content&quot;:&quot;$chung&quot;}}}' -u username:accessToken -X PATCH https://api.github.com/gists/{gist_id}</code>, where <code>$chung</code> was set equal to the file contents of &quot;testingFile.txt&quot;. This exact code would just end up uploading the text &quot;$chung&quot; to the gist, instead of the variable's actual contents (which for this example, is <code>[&quot;WelcomeToTheJungle&quot;, &quot;AmazonRainforest&quot;, &quot;Brazil&quot;]</code>. Any suggestions on how to do this are welcome, cheers!</p>
  <p><strong>EDIT:</strong> Github's API for this is- <a href="https://docs.github.com/en/rest/reference/gists#update-a-gist" rel="nofollow noreferrer">https://docs.github.com/en/rest/reference/gists#update-a-gist</a></p>