Search code examples
gist

Add another file to existing GitHub Gist


I've got an existing GitHub Gist, and I'd like to add another file to it.

The data model for the GitHub Gist API indicates that more than one file can be added to a Gist.

How can I accomplish this?


Solution

  • https://developer.github.com/v3/gists/#edit-a-gist

    Note: All files from the previous version of the gist are carried over by default if not included in the object. Deletes can be performed by including the filename with a null object.

    ^So just pass the files object containing your new file with the PATCH request and it will be added to the gist