简体   繁体   中英

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.

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.

Im aware that it could be possible with git clone, but wget would be here more convenient for me if it was possible.

Is there a way to download everytime the latest version of this file from my master branch?

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

Yes. You can use the 'HEAD' keyword in the URL instead of the 'commit-sha-num' part.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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