Download an archive from Bitbucket Server
With Bitbucket Data Center and 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:
- Go to either the Source view, Commit view, or Branches list of a repository.
- Using the branch selector to choose a branch.
- 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:
- Click on the hash number of a commit to view a single commit.
- Click Download this commit in the upper-right panel.
To download a repository archive from a tag:
- Go to either the Source view, Commit view, or Branches list of a repository.
- Using the branch selector to choose a tag.
- 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'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:
- Follow any of the instructions listed above, so that you are viewing the source you want to download.
- Right-click the Download link and copy the URL address.
Paste the URL in the browser, it would look something like this:
.../projects/TIS/repos/website/archive?format=zip
Change
format=zip
to the format of your choice.
For .tar.gz files, change the argument toformat=
.tgz
For .tar files, change the argument toformat=
.tar
- When you hit Enter the file will download from your browser.