How to attach file to a GitHub issue?
Asked Answered
S

13

233

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?

Slash answered 9/6, 2012 at 17:47 Comment(7)
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.Slash
as of today gitHub allows image upload in the issuesCarcinoma
A nice way to get screenshots attached to issues is Usersnap - you can send screenshots with annotations directly from within your web app to GitHub Issues!Nutation
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 PDFIterate
Also accepts ZIP and GZ, which is handy for reproducers: help.github.com/articles/…Mytilene
It's kind of shameful that we cannot add movies describing bugs to our issues on Github. 👺Xenophanes
@Xenophanes movies can be attached now see this answerCham
A
258

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

Asymptote answered 9/6, 2012 at 17:53 Comment(16)
Oh God, I was afraid of this answer :)Slash
One easy place to do the upload is Github's own Gist service: gist.github.comIndoors
This answer should probably be updated as Github now allows you to upload images for commets.Nicodemus
Unfortunately, Github doesn't allow upload of PDFs :(Bridgman
Got so excited about copy paste but it didn't work for images (got this) when copying from macTanyatanzania
i can prove that uploading with drad&drop works for me. Using OS X.Edla
@Slash Why did you afraid?! The number of votes on your comment make me curious to know! :)Stivers
@Abraham My "afraid" comment was posted before Dominik updated his answer. I hope now makes sense.Slash
@Indoors can you actually attach an image to a Gist? how u do that?Petunia
It would be great to add source code but I suppose you can use a gist for that.Unsecured
@sampablokuper Github has added support for PDFs: imgur.com/UNogHDz (help.github.com/articles/…). Currently non-image attachments require write-access to the repository, "but there's also some discussion about lifting the permission restriction for non-image attachments" (according to Robert from Github support).Antonia
Attaching PDF files no longer requires write-access to a Github repo. So you can now freely attach PDF files to issues.Antonia
If the paste option does not occur, just drag and drop it.Circosta
How would this work for private repos? Would the image be private as well?Dramatization
Is there a way to do it on the mobile website from a phone?Cobden
I have no way to copy the video, or drag & drop, is there a button for this?Maness
C
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.

Cribbage answered 8/12, 2012 at 1:28 Comment(0)
M
40

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

Mccay answered 21/4, 2018 at 5:25 Comment(2)
good answer. it's just markdown format. ![image](your_image_url)Pogey
But it also auto-uploads the file to GitHub for you.Mf
I
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

Iterate answered 24/7, 2014 at 21:11 Comment(3)
I just can't fine the feature in ZenHub.io. would you please show how it is done?Lankford
They may have removed it as it supported by github without plug-ins now.Iterate
so now we can attach any arbitrary files to a comment/issue? I just can't find it!Lankford
N
14

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

Nnw answered 10/6, 2012 at 6:44 Comment(0)
F
11

The format for embedding images into a GitHub comment is:

Format:  ![Alt Text](url)
Example: ![GitHub Logo](/images/logo.png)
Federalese answered 24/11, 2012 at 19:11 Comment(1)
Thank you. An answer that doesn't require drag-and-drop. This is exactly what I needed. :)Cult
C
2

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

Coleville answered 2/6, 2016 at 9:1 Comment(1)
Its not clear how to use gist for that purpose. There is add file button, but it doesn't open attach window.Paternity
N
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.

Nnw answered 16/12, 2020 at 21:52 Comment(0)
F
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

Finfoot answered 9/6, 2012 at 18:12 Comment(0)
Q
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.

Quaint answered 9/8, 2012 at 9:31 Comment(1)
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.Quaint
B
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.

Buckeen answered 16/2, 2015 at 19:19 Comment(0)
E
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 :)

Episode answered 4/12, 2012 at 15:36 Comment(0)
F
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

Financier answered 8/1, 2021 at 11:12 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.