A lightweight Chrome extension that adds a Shallow clone button next to GitHub's Code button.
Click once to copy:
git clone --depth=1 https://github.com/<owner>/<repo>.git- Adds a button beside the repository Code button on GitHub pages.
- Copies shallow clone command with one click.
- Supports GitHub dynamic navigation (PJAX/Turbo).
- Works with modern GitHub UI and has fallback logic for older layouts.
- Minimal permissions (
clipboardWriteonly).
- Download this repository as ZIP, or clone it locally.
- Open
chrome://extensions/(Edge:edge://extensions/). - Enable Developer mode.
- Click Load unpacked.
- Select this project folder.
- Open any GitHub repository page, for example:
https://github.com/owner/repo - Find Shallow clone next to the Code button.
- Click it.
- Paste command in your terminal.
git clone --depth=1 https://github.com/octocat/Hello-World.gitmanifest.json: Chrome extension manifest (MV3)content.js: Injects the button and handles copy logicREADME.md: Documentation
- Button does not appear:
- Make sure you are on a repository page (
https://github.com/<owner>/<repo>). - Refresh the page after extension reload.
- Confirm extension is enabled in
chrome://extensions/.
- Make sure you are on a repository page (
- Copy failed:
- Retry once after clicking the page body to ensure clipboard permission context.
After changing code:
- Go to
chrome://extensions/ - Click Reload on this extension
- Refresh GitHub page
MIT