Emacs package to open a file on a git remote. Inspired by git-open
From the current buffer, call the function to open file on remote to open in browser:
M-x git-open
To simply copy the remote file path to clipboard, call:
M-x git-open-copy
To view the blame view on the remote, call:
M-x git-open-blame
git-open-blame
also has a copy function instead of opening in browser: git-open-blame-copy
.
Both git-open
and git-open-blame
, and their respective copy functions, will open the file by default,
but if a region is selected, then that range of lines will be highlighted on the remote.
emacs-git-open
similarly allows you to open the current commit from a magit-blame
buffer:
M-x git-open-commit
My typical workflow often involves wanting to open up remote files from the default remote branch, either to link them to others or to view unmodified files.
By default, this branch is assumed to be main
, but it can also be configured on a per-project
basis by editing .git/config
:
[init]
defaultBranch = some-default
- Support remote targets other than 'origin'
- Support other git hosting services (gitlab, bitbucket etc.)
- Tests
- Packaging for MELPA