How to download specific files from a Bitbucket repository

Still need help?

The Atlassian Community is here for you.

Ask the community

 

Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.

   

Summary

This guide provides step-by-step instructions on how to download files from a Bitbucket cloud repository using either the Bitbucket Cloud UI or the API v2.0 endpoint.


Solutions

Option 1 - Download the file via the UI

  1. Navigate to the file(s) in the Bitbucket Cloud Repository UI by clicking on the Source tab.
  2. Open the files you want to download.
  3. On the right-hand side, click the ... button.
  4. Select Open Raw.

Opening the file in Raw will automatically download it. If you want to download code/text or anything other than binary files, you'll need to manually save it right-clicking and using your browser's "Save As" option.

Option 2 - Download the file via the cURL utility

(info) Before proceeding, ensure you have the following prerequisites: Workspace ID, Repository URL, Branch Name, and App password.

Follow these steps:

  1. Locate the files you want to download in the Bitbucket Cloud repository from the Source tab.
  2. Use the following example cURL command to download the file:
curl -s -S --user <username>:<App Password> -L -O https://api.bitbucket.org/2.0/repositories/<WorkspaceID>/<RepoName>/src/<BranchName>/<FolderName>/<FileName>

Replace the placeholders in the command with your specific information:

  • <Username>: Your username
  • <App Password>: Your generated App Password
  • <WorkspaceID>: Your Workspace name.
  • <RepoName>: Your Repository name.
  • <BranchName>: The Branch name.
  • <FolderName>: If the file is in a folder, provide the folder name.
  • <FileName>: The file's name, including the file extension, for example:(example.txt).


If the above instructions do not assist you with downloading files from your repository, please raise a support ticket or raise a community support ticket for further assistance with this.

DescriptionHow to download specific files from a Bitbucket repository
ProductBitbucket Cloud
Last modified on Jan 24, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.