Cloning a single file from Github Repo

Is it possible to clone a single file from a remote repository using Git? For example, I am looking for a copy of another .htaccess file in my own project. I do not need their entire repository, only this one file.

+7
git version-control github git-clone
source share
1 answer

Instead of cloning, perhaps you can just upload the file.

Assuming the repository is public, you can upload a single file as follows:

wget https://raw.githubusercontent.com/jquery/jquery/master/src/ajax.js 

To get the URL, go to the file on GitHub and select "raw".

+14
source share

All Articles