228

I migrated with a project from Bitbucket to GitHub and I cannot find a way to attach a file to an issue (ex: screenshot, specs, etc).

How to do it?

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
Alex
  • 5,510
  • 8
  • 35
  • 54
  • 1
    Ok, the solution I found to fit me is: Keep the main repo on Bitbucket and make a mirror on Github (sorry Github) and also point all (eventually) Github issues to the Bitbucket counterpart. – Alex Aug 09 '12 at 13:04
  • 3
    as of today gitHub allows image upload in the issues – Gaurav Shah Dec 10 '12 at 12:08
  • 2
    A nice way to get screenshots attached to issues is [Usersnap](https://usersnap.com/connect/github) - you can send screenshots with annotations directly from within your web app to GitHub Issues! – Gregor Jul 01 '14 at 14:09
  • 4
    As of 11/03/2015 you can now upload these types of files to github without any extension or plug-in: PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, or PDF – jfountain Nov 05 '15 at 21:54
  • 1
    Also accepts ZIP and GZ, which is handy for reproducers: https://help.github.com/articles/file-attachments-on-issues-and-pull-requests/ – Vsevolod Golovanov Feb 02 '16 at 13:40
  • It's kind of shameful that we cannot add movies describing bugs to our issues on Github. – Jonny Jun 21 '17 at 02:19

13 Answers13

255

You upload it somewhere and add the link in a comment. GitHub's Issues is rather primitive and doesn't allow attaching files.

Update: You can post images to GitHub issues now. The easiest way is to copy the image (right click, Copy image) and then paste it into the text box where you describe the issue.

OR

Just drag and drop

101
  • 8,514
  • 6
  • 43
  • 69
Dominik Honnef
  • 17,937
  • 7
  • 41
  • 43
45

As of December 7, 2012, you can attach images by drag/drop or use a file chooser. See https://github.com/blog/1347-issue-attachments for more details.

Tim Schaub
  • 6,722
  • 1
  • 26
  • 17
39

To attach a file to an issue or pull request conversation, drag and drop it into the comment box.

The maximum size for files is 25MB and the maximum size for images is 10MB.

Upload Image

Burhan Nasir
  • 644
  • 6
  • 14
17

ZenHub.io Chrome plug-in will enable you to add any type of file to a github issue. It's stored on ZenHub's AWS server instead of github.com. From their website...

GitHub only allows you to upload image files. ZenHub adds the ability to upload any type of file into issues and comments, transferring securely to Amazon S3. With this you can really take your workflow to the next level; try using GitHub for everything! Centralized collaboration and transparency are awesome.

Update:

As of 11/03/2015 you can now upload these types of files to github without any extension or plug-in: PNG, GIF, JPG, DOCX, PPTX, XLSX, TXT, or PDF

jfountain
  • 3,715
  • 2
  • 24
  • 22
13

As an illustration of the previous answers, see this comment:

I create a repository called catfood http://github.com/blueheadpublishing/catfood/ where I keep misc stuff (like screenshots and other attachments).
That way I can reference them in issues.

See https://github.com/blueheadpublishing/bookshop/issues/10

Some images showing the types of layout templates we want to have generated by templates:

Back in 2009, GitHub expressed the intent to add attachment to issues.

Attachments are something we'd like to add.

That topic wasn't raised since in the GitHub group though...

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
10

The format for embedding images into a GitHub comment is:

Format:  ![Alt Text](url)
Example: ![GitHub Logo](/images/logo.png)
Matt Faus
  • 6,321
  • 2
  • 27
  • 43
2

Use gist.github.com to upload any contents like code, log, html files etc. and share the link.

Vivek Kulkarni
  • 79
  • 1
  • 10
2

8 years later (Dec. 2020), you can not only drag and drop images to PR/issues, but also... videos!
And in May 2021, this is now generally available.

Video upload public beta

You can now upload .mp4 and .mov files to issue, pull request, and discussion comments to share reproduction steps, design ideas, and experience details with your team.

enter image description here

The public beta will gradually rollout to all GitHub accounts over the coming week.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
1

It's a bit of a kludge but you could create a junk branch, then commit the file to that branch and purge it later.

EDIT: This script may be of use to you:

https://github.com/wereHamster/ghup

richo
  • 8,717
  • 3
  • 29
  • 47
1

I found an easy way to embed images in issues using Skitch. Just set up Skitch sharing and auto-copy the URL to the clipboard. Then paste it in when writing up the issue. I blogged about it here.

Dogweather
  • 15,512
  • 17
  • 62
  • 81
  • I heard about this. The reviews in the Mac app store are pretty bad for the new version. And it sounds like they might have removed the functionality to do this image embedding. – Dogweather Sep 23 '12 at 05:07
1

One quick/easy hack is to upload your attachment (say PDF or Office doc) to Dropbox, then include the Dropbox URL in the Github issue.

Mildly easier than using S3; many organizations are already using Dropbox; and Dropbox has good support for viewing many documents inline in the browser already.

achiang
  • 181
  • 1
  • 2
0

OK, here's what I use for screenshots.

http://www.techsmith.com/jing.html

It's free, fast, automatically uploads the image and pastes a URL link to your clipboard which you can Ctrl-V into the GitHub issue instantly.

It was a big sigh of relief when I discovered this :)

harunahi
  • 724
  • 1
  • 6
  • 14
0

If your image is already uploaded to github, then you can attach raw link to issues. For example, if your image's location in github is:

https://github.com/Qlio/someproj/blob/master/assets/image.png

then you can can change blob to raw like this:

https://github.com/Qlio/someproj/raw/master/assets/image.png

and then you can use this link to show image:

![My cool Image](https://github.com/Qlio/someproj/raw/master/assets/image.png)

enter image description here

Bulgantamir
  • 1,514
  • 1
  • 14
  • 21