Download specific files from github in command line, not clone the entire repo

前端 未结 5 968
灰色年华
灰色年华 2021-02-05 09:18

How do I download just 2 files from github using command line ?
Something in the lines of :

git fetch git://github.com/username/Project.git/file1
git fetch          


        
5条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-05 09:59

    Copy the specific file's raw link from GitHub.(As you open the file in Github, on the top right corner you can see the option to open the file in raw mode. Open it in raw mode and copy the URL)

    Now use curl command in command line to download the file.

    curl -o filename raw-link-to-file
    

提交回复
热议问题