我正在尝试使用wget从github私人项目中获取原始文件。通常如果我的项目是公开的,那很简单
对于公共回购,这是我的回购网址(您无需单击它即可回答此问题)
https://github.com/samirtendulkar/profile_rest_api/blob/master/deploy/server_setup.sh
舔完原始内容后,我的网址看起来像这样
https://raw.githubusercontent.com/samirtendulkar/profile_rest_api/master/deploy/server_setup.sh(注意,仅在URL中添加了单词raw)
那我很棒
ubuntu@ip-172-31-39-47:~$ wget https://raw.githubusercontent.com/samirtendulkar/profile_rest_api/master/deploy/server_setup.sh
当我这样做时ls
,表明文件已下载
ubuntu@ip-172-31-39-47:~$ ls
'server_setup.sh'
对于私人回购原始文件带有令牌
https://github.com/samirtendulkar/my_project/blob/master/deploy/server_setup.sh
到目前为止一切顺利现在,当我单击Raw时(请参见上图),我的URL发生了更改,并在其中带有令牌以及“ raw ”前缀
网址具有这些额外的参数 ?token=AkSv7SycSHacUNlSEZamo6hpMAI6ZhsLks5b4uFuwA%3D%3D
我的wget不起作用。如何解决此问题。顺便说一句,当我说它不起作用时,我的意思是代替ls
展示
ubuntu@ip-172-31-39-47:~$ ls
'server_setup.sh'
如下图所示
ubuntu@ip-172-31-39-47:~$ chmod +x server_setup.sh
和
ubuntu@ip-172-31-39-47:~$ sudo ./server_setup.sh
-O
一次仅下载一个文件时,可以使用wget的选项:
wget -O server_setup.sh https://raw.githubusercontent.com/samirtendulkar/my_project/master/deploy/server_setup.sh?token=AkSv7SycSHacUNlSEZamo6hpMAI6ZhsLks5b4uFuwA%3D%3D
缺点是您必须知道输出文件名,但是如果我很好地理解您的问题,我认为可以。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句