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 git@gist.github.com:2963192.git 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:

https://gist.github.com/raw/2963192/36e1ec2c185905bbfd545a30950ba060183e30ea/grant_p-s_bug.png  
https://gist.github.com/raw/2963192/5f708ea14fbd75c28e5e95ee891c36894ce48f46/grant_p-s_persona_bug.png

Embedding remote images in Github issues

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

![BrowserID](https://gist.github.com/raw/2963192/36e1ec2c185905bbfd545a30950ba060183e30ea/grant_p-s_bug.png)  
![Persona](https://gist.github.com/raw/2963192/5f708ea14fbd75c28e5e95ee891c36894ce48f46/grant_p-s_persona_bug.png)

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).

I found a nice solution using Skitch: http://www.g33klaw.com/2012/08/attaching-images-to-github-issues-with-skitch/
Comment by Robb
I just wrote a blog post about another alternative. It's handy for not only embedding images but also commented images and diagrams: http://figurepool.com/blog/Embedding_images_and_diagrams_in_github_wiki_pages_and_issue_tracker.html
Comment by David Durman
Github just listened to you: https://github.com/blog/1347-issue-attachments
Comment by Eric
comment 4
I would hardly count image hosting as being equivalent to generic file hosting.
Comment by Duncan