如何获取Github仓库中的图片链接


Github可以作为一个图床,将图片啥的上传至仓库,只要知道图片的真实链接地址,就可以在浏览器里直接访问。当然前提是有该文件的 访问权限

  1. 使用 https://raw.githubusercontent.com/用户名/仓库名/分支名/图片名
https://raw.githubusercontent.com/pudgelee/blogPicGo/master/ScreenShot2021-07-13_04-53-06_width=734_height=389.png
![](https://raw.githubusercontent.com/pudgelee/blogPicGo/master/ScreenShot2021-07-13_04-53-06_width=734_height=389.png)

  1. 使用 https://github.com/用户名/仓库名/blob/分支名/图片名?raw=true

注意需要在 地址末尾添加 ?raw=true,该链接最终都会重定向至 raw.githubusercontent.com

https://github.com/pudgelee/blogPicGo/blob/master/ScreenShot2021-07-13_04-53-06_width=734_height=389.png?raw=true
![](https://github.com/pudgelee/blogPicGo/blob/master/ScreenShot2021-07-13_04-53-06_width=734_height=389.png?raw=true)


文章作者: PudgeLee
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 PudgeLee !
评论