VSCode extension to open the current file in GitHub/GitHub Enterprise with line selection.
- Open the current file in GitHub/GitHub Enterprise browser
- Automatically includes selected line numbers in the URL
- Supports both GitHub.com and GitHub Enterprise
- Works with any git remote
- Open a file in your git repository
- Select the lines you want to link to (or just place cursor anywhere)
- Use one of the following method:
- Open Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) and run "Open in GitHub"
- Open Command Palette (
The extension will open your default browser with the GitHub URL pointing to the selected lines.
- Git must be installed and available in PATH
- The file must be in a git repository with a remote configured
The extension:
- Gets the current git branch
- Retrieves the remote URL (defaults to 'origin')
- Converts SSH URLs to HTTPS format
- Constructs a GitHub URL with the file path and line numbers
- Opens the URL in your default browser
Initial release of Open in GitHub extension.
MIT