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