[教學] GitHub + PicGo + VSCode Extension

註記:此頁為由 AI(gpt-5-mini-2025-08-07)自動翻譯自英文原文,可能含有少量不準確之處。

📌 介紹

本文說明如何設定 GitHub、PicGo 與 VSCode 延伸功能,以方便將圖片上傳到 GitHub 儲存庫。說明必要的前置條件、產生 GitHub Token 的流程,以及在 VSCode 中設定 PicGo 延伸功能的重點步驟。

🚀 快速開始

開始之前

請確認您已具備以下項目:

  • A Github Token with access to your repo
  • A repo to store images

GitHUb

Generate GitHub Token

  1. Go to Settings/Developer settings/Personal access tokens/Token (classic)
  2. Click Generate new token (classic)
  3. Set a name for the token to identify it easily and choose No expiration
  4. Select the required scopes for the token

image
image
image
image
image

Set Up Repo

為確保您的圖片可被存取,請將儲存庫設定為 public

VScode Extension

  1. Install PicGo extension in VScode
  2. Set Pic Bed: Current to github
  3. Set Pic Bed > Github: Repo to your previously created public repo. Format is {username}/{repo_name}
  4. Set Pic Bed: Uploader to github
  5. Set Pic Bed > Github: Branch to the branch of your public repo
  6. Set Pic Bed > Github: Token to the Github token you created earlier

image
image

20260219175145

Troubleshooting

If you see the following error, it means xclip is not installed:

1
PicGo: xclip not found! Please install xclip before run picgo.

To fix this, install xclip using the following command:

1
sudo apt install xclip

🔁 重點回顧

  • You need a Github token and a public repository for image storage.
  • Install the PicGo extension in VSCode for image uploading.
  • Follow specific configuration steps in the PicGo extension to link it with GitHub.
  • Potential troubleshooting includes ensuring xclip is installed on your system.
作者

Hsiang-Jen Li & ChatGPT-4o Mini

發表於

2025-01-29

更新於

2025-02-28

許可協議