How to download a single file or folder from a remote repository like GitHub, BitBucket, or GitLab?

How to download a single file from GitHub, GitLab, or Bitbucket?

Git does not support downloading parts of the repository. You have to download all of it. But you should be able to do this with GitHub.

When you view a file it has a link to the “raw” version. The URL is constructed like so

By filling in the blanks in the URL, you can use Wget or cURL (with the -L option, see below) or whatever to download a single file. Again, you won’t get any of the nice version control features used by Git by doing this.

How to download a single folder or directory from GitHub, GitLab, or Bitbucket?

There are a few tools created by the community that can do this for you:

Leave a Reply