Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Github readme image embeds in private repo?

I'm trying to embed an image in my readme.md for display on GitHub. I've had no trouble doing this before with public repositories, in this format:

![header image](https://raw.github.com/account/reponame/master/myimage.png) 

I'm now doing the same for a private repo that lives under an organization account and getting a 404. If I navigate to the image in the repo and get the raw URL, I get something like:

https://raw.github.com/account/reponame/master/myimage.png?login=jackaperkins&token=b295d913f6bf6e5cf1115755fb05e770 

Is there a way to tell GitHub to embed the real authenticated URL? I figured the access to the resource would be controlled with sessions outside of the URL but apparently not.

like image 738
Jock Avatar asked Sep 21 '13 21:09

Jock


People also ask

Can you add images in GitHub readme?

README.md files are created using Markdown which you can use to format text and add images.

Where do I put images in GitHub readme?

Copy the images URL and paste it into your README.md file.

Can Markdown files contain images?

You can add images to Markdown using the [alt text](image_url) syntax.


1 Answers

You need a token if you use the raw paths. Assuming that the image file is in the same repository, you can do it like this:

![Image](../blob/master/myimage.png?raw=true) 

More on github blog

like image 154
Alexandru Guzinschi Avatar answered Oct 03 '22 18:10

Alexandru Guzinschi