Forked from https://github.com/wojteklu/xcode-open-on-github
to use gh
command-line tool.
(Leveraging gh
is highly reliable and works with all types of repo clones.)
This provides a Quick Action for Xcode to jump to a source code line on Github.
Select text on a line, or a range of lines, right-click to access the shortcut, and it will open the source on Github.
brew install gh
gh browse
and follow the instructions to setup the tool.
After following the setup, run gh browse
again and ensure it opens the Github repo in a browser.
Double-click the file in quick-actions directory to add it to the Services menu.