Copy Git Provider URL
A VS Code extension that allows you to easily copy git provider URLs for the current file with different reference types.
Features
- Copy Git URL at Current Hash: Copy a URL pointing to the current file at the current commit hash
- Copy Git URL at Current Branch: Copy a URL pointing to the current file at the current branch
- Copy Git URL at Trunk: Copy a URL pointing to the current file at the origin trunk (main/master)
The extension automatically detects the git provider and formats the URL accordingly. Supported providers:
URLs include the current line number based on your cursor position.
Usage
- Open a file in a git repository
- Open the Command Palette (
Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux)
- Type and select one of:
Copy Git URL at Current Hash
Copy Git URL at Current Branch
Copy Git URL at Trunk
- The URL is copied to your clipboard and displayed in a notification
Requirements
- The file must be in a git repository
- The repository must have a remote named
origin
Extension Settings
This extension does not require any settings.
Known Issues
None at this time.
Release Notes
0.0.1
Initial release with support for copying git URLs at hash, branch, or trunk.
| |