Sometimes I want to provide a link to some source code in the comment to an issue.
If I open repository in browser and find the fileI need, the link refers to master
branch by default. It means that over time the code referred by the link will change, because the master
will move together with commits history.
In GitHub and GitLab when you want to get a permanent link on a file you just opened, it is enough to press y
on the keyboard and the link will switch from referring the master branch to particular commit hash it points to.
I.e. https://github.com/octocat/Hello-World/blob/master/README
-> https://github.com/octocat/Hello-World/blob/7fd1a60b01f91b314f59955a4e4d4e80d8edf11d/README
At work I use BitBucket server (v7.10.1, if it matters) and unfortunately the y
does not work, and I also do not see any button on UI to get permanent link. How can I achieve the same result (get permanent link) on BitBucket server?
I know a couple of tricks I am not satisfied with:
- using Bitbucket Linky plugin for Intellij, but I want a more light-weight way
- pressing History button on a file, and choosing the most recent one (but it does not give you the
master
hash, it gives the hash of the last change of the file. And also this button won't work if the file has a single version and never changed after the 1st commit)