How to add an image to a gist
source link: https://gist.github.com/mroderick/1afdd71aa69f6b29601d335751a1a9be
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
How to add an image to a gist
-
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 [email protected]:<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
For those that are not as familiar with command line can do it another way. If you open the issues tab of a repo on GitHub, you can drag and drop the file into an Issues and it will create a link that you can easily add to Gist. Paste the link into the Gist and save the Gist as a .md file.
Great resource
Author
For those that are not as familiar with command line can do it another way. If you open the issues tab of a repo on GitHub, you can drag and drop the file into an Issues and it will create a link that you can easily add to Gist. Paste the link into the Gist and save the Gist as a .md file.
That's a great tip!
thank you
Awesome Tip
Thanks!
thanks for the steps- my suggestion is that don't you think a link on what is gist is will.
Thanks for sharing. For those who get authentication errors while running git push origin master
like me, try to create a new personal access token at https://github.com/settings/tokens and use that one instead of your GitHub password (see https://stackoverflow.com/a/31305980/4964553). This should help, especially if you use two factor authentication.
Thanks for sharing. For those who get authentication errors while running
git push origin master
like me, try to create a new personal access token at https://github.com/settings/tokens and use that one instead of your GitHub password (see https://stackoverflow.com/a/31305980/4964553). This should help, especially if you use two factor authentication.
Worked for me, thanks!
Thanks
Any idea if this can be done with octokit's rest api?
Nice, i once tried to copy paste the bytes and it didnt work ofc
You can also just convert image to SVG...
so easy in hindsight - thanks Morgan!
Hi,
Easier would be to comment your Gist and add an image there.
Copy past the image in your gist. image
Hi,
Easier would be to comment your Gist and add an image there.
Copy past the image in your gist. image
Even easier - thanks iMhack
Hi,
Easier would be to comment your Gist and add an image there.
Copy past the image in your gist. image
Hi, Easier would be to comment your Gist and add an image there. Copy past the image in your gist. image
Not working for me:
> git push origin main
remote: Permission to write to gist denied.
The requested URL returned error: 403
Just push in master branch
Just push in master branch
There is no master branch. It is named main
in this case.
Did a search for this info and, look, it's you!
Friend, thank you for how you give back to the community and to us learners! Big hugs!
Not working for me, unfortunately:
sb@marquez:/tmp/a64609f7e46dc52776685ba86a8e3005$ git push origin master
error: src refspec master does not match any
error: failed to push some refs to 'https://gist.github.com/a64609f7e46dc52776685ba86a8e3005.git'
sb@marquez:/tmp/a64609f7e46dc52776685ba86a8e3005$ git branch
* main
sb@marquez:/tmp/a64609f7e46dc52776685ba86a8e3005$ git push origin main
Username for 'https://gist.github.com': steinarb
Password for 'https://[email protected]':
remote: Repository not found.
fatal: repository 'https://gist.github.com/a64609f7e46dc52776685ba86a8e3005.git/' not found
sb@marquez:/tmp/a64609f7e46dc52776685ba86a8e3005$
Not working for me, unfortunately:
sb@marquez:/tmp/a64609f7e46dc52776685ba86a8e3005$ git push origin master error: src refspec master does not match any error: failed to push some refs to 'https://gist.github.com/a64609f7e46dc52776685ba86a8e3005.git' sb@marquez:/tmp/a64609f7e46dc52776685ba86a8e3005$ git branch * main sb@marquez:/tmp/a64609f7e46dc52776685ba86a8e3005$ git push origin main Username for 'https://gist.github.com': steinarb Password for 'https://[email protected]': remote: Repository not found. fatal: repository 'https://gist.github.com/a64609f7e46dc52776685ba86a8e3005.git/' not found sb@marquez:/tmp/a64609f7e46dc52776685ba86a8e3005$
@steinarb You have to use only git push
without the origin master
Ah! Thanks!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK