Bitbucket/Uploading Files

Files are typically uploaded to a remote git repository using, however, Bitbucket also supports uploading files using a REST API.

Bitbucket also offers a free program called Sourcetree that can manage file uploads (and other pull requests) visually.

Prerequisites

 * 1) Complete the Bitbucket/Get Started tutorial to create a Bitbucket account and learn how to create a repository and add files.
 * 2) Create a repository.

Readings

 * 1)  REST API
 * 2) Atlassian: Bitbucket API - src
 * 3)  cURL
 * 4) Insomnia: REST Client

Upload a File to the Downloads Folder
Bitbucket has a Downloads folder which supports uploading and downloading files. This provides easy uploading and downloading, but files are not part of the repository source.
 * 1) Using the Bitbucket website, select the repository.
 * 2) On the left, select the Downloads folder.
 * 3) Select Add Files to add files. Files may be accessed or referenced using the full file URL.

Upload a File Using cURL
Files may be uploaded as source files using a command-line interface (CLI). Users comfortable with a CLI may use cURL.
 * 1) cURL is included in Linux and macOS. Windows users must download cURL from Haxx.se: curl or use a tool that includes it (such as Git Bash).
 * 2) Open a terminal or command prompt window and navigate to the folder that contains the file to be uploaded.
 * 3) Use the following command to upload a file, replacing the username, password, account name, repo path, and filename:
 * 4) Check your Bitbucket repository to verify that the file was uploaded successfully. Note that some files may take up to several minutes to appear.

Examples

 * Upload example.jpg to the root folder:


 * Upload example.jpg to the assets folder with a different filename:

Upload a File Using Insomnia REST Client
Files may be uploaded as source files using a REST API. Users preferring a graphic user interface (GUI) may use the Insomnia REST client.
 * 1) Download and install Insomnia from Insomnia: REST Client.
 * 2) Run Insomnia.
 * 3) Create a new request. Name the request , select   as the request type, and   as the content type.
 * 4) At the top, enter   for the URL, replacing myaccount and myrepo with your Bitbucket account and repository name.
 * 5) Under Multipart, enter   for the new name, replacing   with the filename and extension of your file. Select   as the value and use   to select the file.
 * 6) Under , select   and enter your Bitbucket username and password.
 * 7) Send the request.
 * 8) Check your Bitbucket repository to verify that the file was uploaded successfully.