A lightning-fast, zero-dependency extension to open your Git repositories, branches, and active files in the browser. Natively parses ~/.ssh/config to handle multi-profile host aliases.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
A lightning-fast, zero-dependency extension to open your Git repositories, branches, and active files in the browser. Natively parses ~/.ssh/config to handle multi-profile host aliases.
Search for Git - Open Remote Repo/Files in Browser and select this extension
Click Install
✨ Features
Multi-Profile SSH Support: Say goodbye to 404 errors caused by git@github.com-alias URLs. This extension natively parses your ~/.ssh/config file to resolve aliases to their true domains before opening the browser.
Smart Status Bar: The status bar icon dynamically adapts to your workflow. If a file is active, it opens the file. If no file is focused, it opens the repository root.
Line Highlighting: Select lines of code in your editor, trigger the extension, and the browser will open directly to those highlighted lines.
Zero Bloat: Built completely dependency-free using pure JavaScript and native Node modules. No sluggish wrappers or heavy background processes.
Local Branch Protection: Warns you if you attempt to open a file on a branch that hasn't been pushed to a remote yet, offering to open the root repository instead.
🚀 Usage
You can trigger the extension from wherever you are working:
Status Bar: Click the repo or globe icon in the bottom-left corner.
Editor Context Menu: Right-click anywhere inside an open file or on the file's top tab.
File Explorer: Right-click any file or folder in the VS Code sidebar.
Command Palette (Ctrl+Shift+P): Search for Git Open: Repository in Browser or Git Open: Current File in Browser.
⚙️ Extension Settings
This extension contributes the following settings to tailor it to complex environments:
gitOpenRemoteRepoFileInBrowser.statusBarAppearance: (Default: Icon + Text). Choose Icon Only to hide the text label and save valuable space in your VS Code status bar.
gitOpenRemoteRepoFileInBrowser.defaultRemote: (Default: origin). If your repository has multiple remotes (e.g., origin and upstream) and the current branch does not have an explicit tracking remote, the extension will default to this value.
gitOpenRemoteRepoFileInBrowser.customProviders: (Default: {}). If you use a self-hosted enterprise Git server (e.g., git.internal-corp.com), you can map it to a known provider so the URL formats correctly. Supported target formats are github, gitlab, and bitbucket. (Note: If left unconfigured, unknown domains automatically fall back to the standard GitHub URL format).