Link latest file on Bitbucket Git repository

前端 未结 5 1962
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-24 04:21

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/wordle

相关标签:
5条回答
  • 2020-12-24 04:41

    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.

    0 讨论(0)
  • 2020-12-24 04:48

    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.

    0 讨论(0)
  • 2020-12-24 04:48

    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
    
    0 讨论(0)
  • 2020-12-24 04:59

    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.

    0 讨论(0)
  • 2020-12-24 04:59

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

    0 讨论(0)
提交回复
热议问题