简体   繁体   English

从bitbucket中获取原始文件,并在wget链接中获取不带Commit-SHA编号的最新版本

[英]Wget raw file from bitbucket and get the latest version without Commit-SHA number in the wget link

I try to download an installscript shell file which I host on BitBucket. 我尝试下载我在BitBucket上托管的installscript shell文件。

currently im using following command: 当前即时通讯使用以下命令:

wget https://bitbucket.org/projectname/reponame/raw/commit-sha-num/installscript.sh

Later I want to have the possibility to modify my installscript.sh and want that the latest version is downloaded instead of a specific checkout with the commit-sha-number. 稍后,我希望可以修改我的installscript.sh,并希望下载最新版本,而不是下载带有commit-sha-number的特定结帐。

Im aware that it could be possible with git clone, but wget would be here more convenient for me if it was possible. 我知道git clone是可能的,但如果可能的话,wget在这里对我来说更方便。

Is there a way to download everytime the latest version of this file from my master branch? 有没有办法每次从我的master分支下载此文件的最新版本?

Thanks in advance 提前致谢

The "common" (and horribly insecure) approach to that is nowadays to pipe the downloaded content directly into the shell: 如今,“通用”(且极其不安全)的方法是将下载的内容直接通过管道传输到外壳中:

wget -O - https://bitbucket.org/projectname/reponame/master/installscript.sh | /bin/sh
See also 也可以看看

https://bitbucket.org/site/master/issues/9358/permalink-to-the-head-revision-of-a https://bitbucket.org/site/master/issues/9358/permalink-to-the-head-revision-of-a

Yes. 是。 You can use the 'HEAD' keyword in the URL instead of the 'commit-sha-num' part. 您可以在URL中使用“ HEAD”关键字,而不是“ commit-sha-num”部分。

wget https://bitbucket.org/projectname/reponame/raw/HEAD/installscript.sh

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM