Skip to content

Easily get the repository link to the current file, line or a selection right from Atom using git-link

License

Notifications You must be signed in to change notification settings

keevan/git-link

Repository files navigation

🔗 git-link

Easily get the repository link to the current file, line or a selection

APM GitHub Workflow Status GitHub issues APM GitHub GitHub code size in bytes

Demo

Requirements

You must have git installed.

Quick Start

CLI:

apm install git-link

Or search for the git-link package via Settings > Packages. Read more on Atom Packages.

Supported platforms

Please add an issue if you need support for a platform not mentioned above.

Features

  • Share and open what you've worked on, or a bug you've spotted
  • Copy a link to a line, selection or file for the current commit
  • Additional features added for command-palette-plus
  • Built with convenience in mind (#tips)
  • Handles non-typical file and folders okay - e.g. [myfolder]/my#file.txt
  • References markdown files in plaintext (on supported platforms)

Command list

No keymaps are currently set by default.

I recommended you configure your own keybindings and use what is comfortable for you. You can do this by going to Settings > Keybindings or open it from the Command Pallete using Application: Open Your Keymap.

Command List Description
git-link:copy-link-to-line Copy a link to the current line
git-link:copy-link-to-selection Copy a link to the current selection
git-link:copy-link-to-file Copy a link to the current file
git-link:copy-link-to-repository Copy a link to the current repository
git-link:open-line-in-browser Open the current line in browser
git-link:open-selection-in-browser Open the current selection in browser
git-link:open-file-in-browser Open the current file in browser
git-link:open-repository-in-browser Open the current repository in browser
git-link:edit-line-in-browser Edit current line in browser
git-link:edit-selection-in-browser Edit current selection in browser
git-link:edit-file-in-browser Edit current file in browser

Tips

Personally, I got the most value out of this by:

  • keybinding the git-link:copy-link-to-selection command,
  • leaning on the default behaviour of opening the link on double copy
  • Which means I'm able to copy a link of the current line, a selection or choose to open it in the browser all with one keybind.

Permalinks are possible only if changes are available remotely (changes have been pushed).

Contributing

Please take a look at our contributing guidelines if you're interested in helping out!

Pending features
  • Open a file locally based on a copied link.
  • Add option to disable default behaviour for 'Opening links on double copy'.
  • Custom tracker integration linking (e.g. copy / open link to relevant ticket this last change)
  • Open blame view for file in browser
  • Open history view for file in browser
  • Open issues view for file in browser
  • Open PR/MR view for file in browser
  • Open/Copy compare view/link e.g. to current branch or a commit for file in browser
  • Detect PR branch and have a link ready for that as well (quickly jump to current PR in atom/browser) e.g. when doing a review
  • Open README in browser

Support

If you like or found this project helpful, please leave a star and consider supporting it for further development.

Donate using Liberapay Buy Me A Coffee Buy Me a Coffee at ko-fi.com

License

GitHub