Skip to content

Instantly share code, notes, and snippets.

@Neeratyoy
Forked from mroderick/how-to-add-image-to-gist.md
Last active August 25, 2023 16:52
Show Gist options
  • Save Neeratyoy/b80820ca32f903c66b8541cde78296c2 to your computer and use it in GitHub Desktop.
Save Neeratyoy/b80820ca32f903c66b8541cde78296c2 to your computer and use it in GitHub Desktop.
How to add an image to a gist

How to add an image to a gist

  1. Create a gist if you haven't already.

  2. 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
  3. Go to the directory:

    cd <hash>
  4. Copy poster file into directory:

    cp <path-to-poster>/poster.png .
  5. Add your image to your gist's repository:

    git add poster.png
  6. Commit the image:

    git commit -m "Add poster"
  7. Update gist:

    git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment