Skip to content

keevan/git-link

Folders and files

NameName
Last commit message
Last commit date

Latest commit

b360676 Â· Mar 5, 2022

History

53 Commits
Feb 14, 2022
Feb 14, 2022
Mar 5, 2022
Feb 18, 2022
Mar 5, 2022
Mar 5, 2022
Feb 9, 2022
Mar 5, 2022
Feb 9, 2022
Mar 5, 2022
Mar 5, 2022
Mar 5, 2022
Mar 5, 2022

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

  • Works for GitHub.com (public, tested)
  • Works for GitLab.com (public, tested)
  • Works for BitBucket.org (public, tested)
  • Works for Azure DevOps (dev.azure.com) (public, tested)
  • It might work for others (untested, PRs welcome)

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
  • Built with convenience in mind (#tips)
  • Handles non-typical file and folders okay - e.g. [myfolder]/my#file.txt
  • References markdown files in plaintext.

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 Copies a link to the current line
git-link:copy-link-to-selection Copies a link to the current selection
git-link:copy-link-to-file Copies a link to the current file
git-link:open-line-in-browser Opens the link to the current line in browser
git-link:open-selection-in-browser Opens the link to the current selection in browser
git-link:open-file-in-browser Opens the link to the current file in browser
git-link:edit-line-in-browser Opens edit link to the current line in browser
git-link:edit-selection-in-browser Opens edit link to the current selection in browser
git-link:edit-file-in-browser Opens edit link to the 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 this project or found it helpful, please consider supporting it for further development.

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

License

GitHub