On a production machine I want to check out a specific file at a specific revision from GitHub to facilitate database migration. I don't want to checkout (or even clone) the whole source code repository (because this is my production environment). How can I pull only the file I am looking for?
I do this with for backbones like so
curl -O https://raw.github.com/documentcloud/backbone/master/backbone-min.js
My solution is like in first post. But I try to explain a bit more. There is a "Raw" button on GitHub for every file - it will show just plain text in browser. Also, you can use that url.
For example, I have repo https://github.com/MasterSergius/conf_files.git And I want to get my .vimrc file, so here the link to my file: https://raw.githubusercontent.com/MasterSergius/conf_files/master/.vimrc I do think, that by this template you even can guess file url by repo and file full pathname. So, now I can download it with curl:
curl https://raw.githubusercontent.com/MasterSergius/conf_files/master/.vimrc -o ~/.vimrc
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With