Link latest file on Bitbucket Git repository

GitHyperlinkBitbucket

Git Problem Overview


I have a public Git repository on Bitbucket. I want to link the latest version of a Read-Me file. Here's the link to a revision/commit:

https://bitbucket.org/wordless/thofu-interpreter/raw/5bfc37864c5d/ThoFu%20Interpreter/ReadMe.txt

I tried to replace the revision number with tip and default, but it didn't work. Is there any way to get a permanent link to my latest files?

Git Solutions


Solution 1 - Git

Two ideas:

Use master in the url (this seems to work):

https://bitbucket.org/wordless/thofu-interpreter/raw/master/ThoFu%20Interpreter/ReadMe.txt

Another idea is to create a wiki page for your project, then use the wiki's functionality to link to the latest version of a file with this syntax:

<<file path/to/file [revision] [linenumber]>>

Just omit the revision and line number parameters, they are optional.

Then, refer to the wiki page everywhere else you'd like link to the read me file.

Solution 2 - Git

There is an easy workaround for this issue by updating your relative links to src/[branch_name]/path/to/file. Works like a charm for me.

Solution 3 - Git

The canonical way to add a link to a file in your repository using Markdown (the default for Readme files and Wiki pages) is by linking to the relative path of the file.

For example, if I had a structure like so:

<repo root>
|-- my-file.txt
|    
|-- my-dir 
|    |-- my-other-file

I'd be able to link to them as follows:

[my-file](my-file.txt)
[my-dir](my-dir)
[some-other-file](my-dir/some-other-file)

Bitbucket will then automatically link to the file at the current branch that you are viewing the file at. If you're viewing the Readme file in the overview that will mean the default branch (usually 'master').

Solution 4 - Git

I am using master like this for the last zip file of the code :

https://bitbucket.org/MIUSER/MIREPO/get/master.zip

Where MIUSER is my user and MIREPO is the name of my app.

Hope that this works :D.

Solution 5 - Git

Here are working links:

RAW:
https://bitbucket.org/wordless/thofu-interpreter/raw/HEAD/TODO.txt?at=master&fileviewer=file-view-default
Source:
https://bitbucket.org/wordless/thofu-interpreter/src/HEAD/TODO.txt?at=master&fileviewer=file-view-default

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionThomas UhrigView Question on Stackoverflow
Solution 1 - GitSunil D.View Answer on Stackoverflow
Solution 2 - Gita-froView Answer on Stackoverflow
Solution 3 - GitJVDLView Answer on Stackoverflow
Solution 4 - GitCTalaView Answer on Stackoverflow
Solution 5 - GitbjorkblomView Answer on Stackoverflow