链接 Bitbucket Git 存储库中的最新文件

我在 Bitbucket 上有一个公共 Git 存储库。我想链接一个 Read-Me 文件的最新版本。下面是修订/提交的链接:

Https://bitbucket.org/wordless/thofu-interpreter/raw/5bfc37864c5d/thofu%20interpreter/readme.txt

我试着用 小费违约代替修订号,但是没有用

20250 次浏览

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.

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.

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.

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').

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