How to paste an image directly into an Issue on GitHub – 032

If you don’t know today’s tip, be prepared for a life-changing event (provided you are using Chrome).

Suppose you want to open an Issue on a project on GitHub. For example, let’s say you were learning Electron and tried out my your-moment-of-github-zen app on a Windows machine. You’ll quickly noticed that I wrote it on a Mac environment.

App appears offscreen on Windows

First, you can go to the repo, click on the Issue tab, (search to make sure there are no duplicate issues), and then fill out steps to reproduce the issue.

Place the cursor where you want the new image to go, and press Ctrl-v (or your non-Windows equivalent of paste).

Creating a new issue in repo

Not only will you see that the file was uploaded to GitHub, but also the Ctrl-v shortcut generated the markdown for showing images.

image uploaded and markdown generated

To make sure the image is :+1: click on the Issue – Preview tab.

image appears in preview

If you are not using Chrome, you’ll only see two options listed at the bottom of an Issue comment field.

pasting images not supporting in non-Chrome browsers

meaning you’ll have to save the file locally and then drag and drop it into the comment box (or use the Open File Dialog from the selecting them link).

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s