How to attach file to a github issue?

GithubAttachmentGithub Issues

Github Problem Overview


I migrated with a project from Bitbucket to Github and I can not find a way to attach a file to an issue (ex: screenshot, specs, etc)

How to do it?

Github Solutions


Solution 1 - Github

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

Solution 2 - Github

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.

Solution 3 - Github

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

Solution 4 - Github

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

Solution 5 - Github

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:

> - Example One - Three Percentage Columns

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

Solution 6 - Github

The format for embedding images into a GitHub comment is:

Format:  ![Alt Text](url)
Example: ![GitHub Logo](/images/logo.png)

Solution 7 - Github

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

Solution 8 - Github

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.

Solution 9 - Github

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

Solution 10 - Github

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.

Solution 11 - Github

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

Solution 12 - Github

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.

Solution 13 - Github

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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAlexView Question on Stackoverflow
Solution 1 - GithubDominik HonnefView Answer on Stackoverflow
Solution 2 - GithubTim SchaubView Answer on Stackoverflow
Solution 3 - GithubBurhan NasirView Answer on Stackoverflow
Solution 4 - GithubjfountainView Answer on Stackoverflow
Solution 5 - GithubVonCView Answer on Stackoverflow
Solution 6 - GithubMatt FausView Answer on Stackoverflow
Solution 7 - GithubrichoView Answer on Stackoverflow
Solution 8 - GithubDogweatherView Answer on Stackoverflow
Solution 9 - GithubVivek KulkarniView Answer on Stackoverflow
Solution 10 - GithubVonCView Answer on Stackoverflow
Solution 11 - GithubharunahiView Answer on Stackoverflow
Solution 12 - GithubachiangView Answer on Stackoverflow
Solution 13 - GithubBulgantamirView Answer on Stackoverflow