Download an archive from Bitbucket Server

With Bitbucket Server you can download an archive of source files at a particular point in time; you can download your source as a .zip file from the actions dropdown menu from the Source view, Commits list, and Branches list. You can also download the archive of individual branches, commits, and tags.

On this page:

What's the difference between downloading and cloning a repository?

Cloning a repository copies the source files of a remote repository to your local machine, as well as the repository's Git history (branches, commits, tags, etc.). Cloning also creates a remote connection (usually called origin) pointing back to the cloned repository. You can only clone into a local directory that is a properly initialized Git repository (using the git init command).

 

Downloading a repository archive only copies a repository's source files from a specific point in time, depending on what was chosen to be copied. The biggest difference to downloading an archive is that you are not copying the repository history, or creating a connection to the remote repository. You are only getting the source files, and none of the Git metadata stored in the .git directory.

Download your source as a .zip file

To download a repository archive of a branch:

  1. Go to either the Source view, Commit view, or Branches list of a repository.
  2. Using the branch selector to choose a branch.
  3. Click the actions dropdown next to the branch selector, then select Download.

 

You can also download a repository archive of a specific branch in the actions menu of any branch, as viewed from the Branches list.

 

To download a repository archive from a commit: 

  1. Click on the hash number of a commit to view a single commit.
  2. Click Download this commit in the upper-right panel.

To download a repository archive from a tag:

  1. Go to either the Source view, Commit view, or Branches list of a repository.
  2. Using the branch selector to choose a tag.
  3. Click the actions dropdown next to the branch selector, then select Download.

 

Download your source as a .tar or .tar.gz file

When you download your source file from Bitbucket Server's UI you are downloading the file in .zip format. However, it is possible to edit the URL and get the archive as other formats, like .tar, .gz, or .tar.gz.

To download your source as a file format other than .zip:

  1. Follow any of the instructions listed above, so that you are viewing the source you want to download.
  2. Right-click the Download link and copy the URL address.
  3. Paste the URL in the browser, it would look something like this:

    .../projects/TIS/repos/website/archive?format=zip

  4. Change format=zip to the format of your choice.

    For .tar.gz files, change the argument to format=tgz.

    For .tar files, change the argument to format=tar.

  5. When you hit Enter the file will download from your browser.

 

Last modified on Feb 2, 2021

Was this helpful?

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