Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Have .zip download file name be static ( without commit ID

Currently, when downloading a bitbucket repository as a .zip, the file name is usually something like where the last bit is the most recent commit to the branch being downloaded.

Our usage requires that the name of the file be the same each time it is downloaded, as it automatically overrides the directory (in the WordPress Plugins folder). Is there a way to set the downloads to have a static name instead of the current name of the commit?

1 answer

0 votes
Caroline R Atlassian Team Sep 30, 2021

Hi, @Garrett Massey! Welcome to the community! 

Indeed, if you download the file, it will give you the commit number. However, you can choose the branch you would like to download and use the following command to specify the file name of your download:

BRANCH='{master}'; WORKSPACE='{workspace_name}'; REPO='{repo_name}'; FOLDER='{new_folder}'; curl -u <username>:<password>$WORKSPACE/$REPO/get/$ -s -o $ && unzip -q $ && find ./$WORKSPACE-$REPO-/ -exec mv {} $FOLDER/${f##/} ;

All you need to do is replace the master, workspace_name, repo_name, and new_folder with whatever you need. 

This way, the zip file will be downloaded and it will have the repository name, and another folder will be created in your current working directory with the name you informed in “new_folder". This folder will contain all the content that is inside this zip file (in other words, it will unzip the file). 

I hope this helps, but do let me know if you have any questions. Also, if you would like to open a feature request for that, I can definitely do this for you, just let me know :)

Kind regards,

Thank you for your answer! Unfortunately, this solution isn't quite what we need for our process. We are using WordPress for our websites, and we can't currently specify the curl command like that for getting the zip for updates. 

Our current workflow is that we check the master branch for any changes to a specific file, and then if that file has changed it prompts wordpress to notify for an update. Then the user clicks "Update plugin" and Wordpress fetches the zip from the URL as-is, so we can't use the `-o` option to specify the output file.

If you could open a feature request that would be fantastic. Something that would allow us to set the output in the BitBucket GUI for all downloads would be fantastic.

Caroline R Atlassian Team Oct 01, 2021

Hi, Garrett. 

Thanks for getting back to us! In this case, I created the following feature request to implement this change:

I would suggest that you add your vote there (by selecting the Vote for this issue link) as the number of votes helps the development team and product managers better understand the demand for new features. 

You are more than welcome to leave any feedback, and you can also add yourself as a watcher (by selecting the Start watching this issue link) if you'd like to get notified via email on updates.

Implementation of new features is done as per our policy here and any updates will be posted in the feature request. 

Please, feel free to share any additional questions regarding this subject.

Kind regards,

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

Git push size limits are coming to Bitbucket Cloud starting April 4th, 2022

Beginning on April 4th, we will be implementing push limits. This means that your push cannot be completed if it is over 3.5 GB. If you do attempt to complete a push that is over 3.5 GB, it will fail...

2,239 views 2 9
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you