This is a hack to work-around the lack of support for file attachments on the Github issue tracker.

You can of course host your files somewhere else and link to them, but it's a bit annoying to not be able to attach files directly on a bug report because these remote files might go away in the future and make archived issues much less useful.

Hosting attachments on Github

To host file attachments on Github, you could create a new repository, but then it would clutter up your list of personal repos. A better option is to create a new gist:

  • use the bug title as the description (ideally with the issue number too)
  • put "temp" as the filename (it will be deleted shortly)
  • put something like "TODO" as the file content

At that point, you'll have a new throw-away repository that you can clone on your local machine:

git clone gist-2963192

Once you've done that, delete the temporary file and add the one(s) you want:

git rm temp  
git add screenshot1.png  
git add screenshot2.png  
git commit  
git push

Now, visit your gist page and right-click on each attachment to get its direct URL:

Embedding remote images in Github issues

Finally, to include the above images into my bug report, here's the Markdown code I used:


Hopefully Github will at some point listen to all of the users that have been asking for this feature. In the meantime, if you don't mind the hassle, it is possible to have issues and attachments on the same site (sort of).