Monday, January 7, 2013

BitBucket: How to link to latest revision of file

On my previous post I was trying to link to file in bitbucket, but if you try to link to a file from the “Source” tab in the repo you will get a fully qualified URL to a particular revision. For example:

https://bitbucket.org/farmas/ccnet-dashboard/src/f918370a2e47d38b3c3d85d2370779368864045f/dashboard.html

I just learned that if you want to link to the latest revision of the file you need to replace the revision number to “tip” or “master” (depending if it is a mercurial or git repo). For example:

https://bitbucket.org/farmas/ccnet-dashboard/src/master/dashboard.html

^_^

- Federico

2 comments:

  1. Have you figured out why ?src=master was sometimes appended to the url?

    ReplyDelete
  2. I think you mean "?at=master", as far as I know that is appended if you change the branch or tag using the dropdown that's available in the UI.

    ReplyDelete