-
Create a gist if you haven't already.
-
Clone your gist:
# make sure to replace `<hash>` with your gist's hash git clone https://gist.github.com/<hash>.git # with https git clone git@gist.github.com:<hash>.git # or with ssh
-
Add your image to your gist's repository:
git add your-image.jpg
-
Commit the image:
git commit -m "Add image" -
Update gist:
git push origin master
-
Star
(166)
You must be signed in to star a gist -
Fork
(37)
You must be signed in to fork a gist
-
-
Save mroderick/1afdd71aa69f6b29601d335751a1a9be to your computer and use it in GitHub Desktop.
^ Agreed, change from git push origin master to git push origin main.
The command with ssh is:
git clone git@github.com:HASH.git
I just came here to mention that this no longer works.
You can clone the gist, add the image, push the image back to the gist, but then it overwrites the gist with just the image, and pushes the .md file as an unpreviewable attachment, which can only be viewed in 'Raw' mode.
I just came here to mention that this no longer works.
You can clone the gist, add the image, push the image back to the gist, but then it overwrites the gist with just the image, and pushes the .md file as an unpreviewable attachment, which can only be viewed in 'Raw' mode.
I just tried with a png and it worked well, may be the issue is with markdown files

If you get an error saying:
Since your repository has a branch named "main", you should push your changes to that branch instead of "master". To push to the "main" branch, use the following command:
This command will push the changes in your local "main" branch to the remote repository.