Command "git archive" failure due to "operation not supported by protocol" error

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

Summary

When attempting to use the native git archive utility, an HTTP-related error "operation not supported by protocol" may appear, preventing the archive from completing.

Environment

Bitbucket Cloud

Diagnosis

An attempted archive may fail with the below "operation not supported by protocol" error.

1 2 git archive --output=outfile.txt --remote=https://your-username@bitbucket.org/atlassian/cloudtoken.git HEAD fatal: operation not supported by protocol

Cause

The Bitbucket Cloud platform does not support git archive over the HTTP(s) protocol.

Solution

Use the SSH protocol. This can be resolved by adjusting the remote string to use either of the below syntaxes.

1 2 3 4 5 6 7 # Accepted formats: git archive --output=outfile.txt --remote=ssh://git@bitbucket.org/atlassian/cloudtoken.git HEAD # Continue to use the "ssh://" prefix and adjust the later ":" to a "/" between the hostname and your workspace ID git archive --output=outfile.txt --remote=git@bitbucket.org:atlassian/cloudtoken.git HEAD # Remove the "ssh://" prefix and use a ":" between the hostname and your workspae ID

Updated on March 10, 2025

Still need help?

The Atlassian Community is here for you.