Retrieving the branch download file using SSH

Hello!

I'm currently re-working my company's deployment script*, and I recently found out that you can download the source files of specific branches under "Downloads" > "Branches" on Bitbucket. This is totally awesome and exactly what I'm looking for.

There's a tiny issue though that seems to cause a problem for me. The file is, understandably, only reachable using HTTPS, but I would like to download it from the terminal (Mac) with the SSH-key as the authentication. The reason for this is naturally that the script should be arbitrary for all our developers.

Is there a way to reach this file (specifically, the tarball) from the terminal using SSH?

Many thanks for your time.

Best regards,
Helge Söderstörm

* PS. In case it makes it easier for you to see what help I'm requesting, the deployment script currently clones the Mercurial repo from Bitbucket, including history, thousands of changesets etc before uploading it to our staging server where it is then deployed.

1 answer

Hello,

There isn't a way to download a specific file via SSH at the moment, but that is a great idea. For the time being, you can do one of two things:

  • Use OAuth and setup your deployment server to utilitze that for authentication - Documentation
  • Don't clone every time. Specifically on Bitbucket, we just keep a clone of the repo and pull in the changes up to the commit we wish to deploy.

Hello Marcus! If the functionality to fetch the file is implemented, It'd be awesome to find out =) Meanwhile, I will use your solution of just pulling the repo instead of cloning.

Thanks for the reply.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 12, 2018 in Bitbucket

Do you use any Atlassian products for your personal projects?

After spinning my wheels trying to get organized enough to write a book for National Novel Writing Month (NaNoWriMo) I took my affinity for Atlassian products from my work life and decided to tr...

22,995 views 26 12
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you