GitPaste is an Obsidian plugin designed to simplify handling and managing images in your notes. With GitPaste, you can easily upload images to GitHub, replace local references with GitHub URLs, and organize your image management workflow more efficiently.
-
Drag-and-Drop Upload:
- Drag and drop images into Obsidian to automatically upload them to GitHub.
-
Clipboard Integration:
- Paste images directly into your notes and upload them seamlessly.
-
Local Image Replacement:
- Automatically replace local image links with their GitHub URLs in Markdown.
-
Delete Local Images (Optional):
- Automatically delete local images after uploading them to GitHub.
-
Image URL Logging (Optional):
- Save all uploaded image URLs to a user-specified database file.
-
Customizable Settings:
- Configure GitHub session, toggle deletion of local images, and manage logging preferences.
- Clone or download the repository.
- Place the plugin in your Obsidian plugins folder:
<Your Vault>/.obsidian/plugins/gitpaste
- Restart Obsidian and enable GitPaste in the plugin settings.
- Description: Required for uploading images to GitHub.
- How to Add:
- Copy your GitHub session cookie (see the instructions below).
- Paste it into the "GitHub Session" field in the plugin settings.
- Description: When enabled, deletes the local image file after uploading it to GitHub.
- How to Use:
- Enable or disable it from the plugin settings.
- Description: Save URLs of uploaded images to a database file.
- How to Set Up:
- Toggle logging in the plugin settings.
- Specify the path to the database file (e.g.,
attachments/image_urls.md
).
- Open your browser and go to GitHub.com.
- Log into your GitHub account.
- Open the Developer Tools (usually accessible via
F12
orCtrl+Shift+I
). - Navigate to the Application tab (or Storage in some browsers).
- Look for the Cookies section and find the
github.com
domain. - Locate the cookie named
user_session
(or a similar session key like__Host-user_session_same_site
). - Copy its value and paste it into the "GitHub Session" field in the plugin settings.
⚠️ Warning: Your GitHub session cookie is sensitive information. Do not share it publicly or with untrusted individuals.
-
Drag and Drop:
- Drag any image file into your note.
- GitPaste will upload the image to GitHub and replace the local reference with the GitHub URL.
-
Pasting from Clipboard:
- Copy an image (e.g., using Snipping Tool).
- Paste it directly into your note.
-
Automatic Replacement:
- Local references like
![[image.png]]
will be replaced with GitHub links like:![image.png](https://github.com/user-attachments/assets/7e2baacd-21b1-4f8f-b502-32d2cbd5)
- Local references like
-
Logging Uploaded URLs (Optional):
- If enabled, GitPaste saves all uploaded URLs to a file for future reference.
Setting | Description |
---|---|
GitHub Session | Required to upload images to GitHub. |
Delete Local Image | Toggle whether to delete local images after uploading. |
Enable Logging | Save uploaded image URLs to a user-specified file. |
Database File Path | Path to the file where URLs will be saved (if enabled). |
If logging is enabled, GitPaste will save URLs to the specified file. Example file content:
# Uploaded Images
- **[2025-01-16]** ![example.png](https://github.com/user-attachments/assets/7e2baacd-21b1-4f8f-b502-32d2cbd5)
- **[2025-01-17]** ![diagram.jpg](https://github.com/user-attachments/assets/7e2baacd-21b1-4f8f-b502)
This plugin is open-source and distributed under the MIT License.
- Fork the repository.
- Create a new branch for your feature or bugfix.
- Submit a pull request with a detailed description of your changes.
For questions, issues, or suggestions, open an issue on the GitHub repository.