How to clone a single file from a git remote repository like GitHub, GitLab, or Bitbucket?

Git does not support cloning of individual files or directories but if the remote repository (for example GitHub, GitLab, or Bitbucket) is public, you can use wget or curl command to get a single file from your remote repository.

Example:

Copy a single file from a public remote repository (GitHub):

Get the content of a single file from public remote repository (GitHub):

Copy a single file from a public remote repository (GitLab):

Get the content of a single file from public remote repository (GitLab):

Copy a single file from a public remote repository ( Bitbucket ):

Get the content of a single file from public remote repository (Bitbucket):

Leave a Reply