youngmon/atlassian-qna huggingface dataset:
Repository is growing instead of shrinking
Asked by psyon:

Our repository was over 2GB in size due to some video files that were placed in it by accident. I removed them and rewrote the history, and did a push, and bitbucket says the repository got bigger. I did a repack, and got the local file size much smaller, but again, when I tried to push, Bitbucket now reports that the repository is over 4GB. Locally I get this:

$ git count-objects -Hv  
count: 0  
size: 0 bytes  
in-pack: 17448  
packs: 1  
size-pack: 685.47 MiB  
prune-packable: 0  
garbage: 0  
size-garbage: 0 bytes  

What do I need to do to get the repo to shrink on bitbucket?


Answers:
author: Theodora Boudale
body: Hi [@psyon](/t5/user/viewprofilepage/user-id/3007492),

I checked the repositories your account has access to and I found one over the 4 GB limit. I ran a git gc on it, and its size has been reduced.

If you rewrite history and push it to Bitbucket, the repo's size will go up because the repo will contain both new commits and old ones (prior to history rewrite). A garbage collection is needed to remove the old references and for the repo's size to get reduced. At the moment, this can only be run by the support team.

There is a way for end users to get the garbage collection triggered if the following conditions are met:

* the repo's size is over the 4 GB limit (because of the large push)
* you undo the last push by following our guide here <https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/#Undoing-the-last-push>
* the user who does the push needs to enable the Labs feature "Delete dangling commits when over size limit" on this page <https://bitbucket.org/account/settings/features/> ++prior to pushing++

Then, the garbage collection will be triggered automatically. This is useful if you accidentally pushed a commit with large files, the repo has gone over the size limit, you haven't merged the large commit to any other branches yet, and you want to undo it.

If your repo's size is below 4 GB after the large push, the above won't work and you need to rewrite history with BFG or git filter-branch and push. You can then contact us to trigger the garbage collection. We have a feature request for allowing users to trigger manually a garbage collection for their repos: <https://jira.atlassian.com/browse/BCLOUD-11593>

Kind regards,  
Theodora


author: Erez Maadani
body: I had a similar issue and ended up raising a ticket to [support](https://support.atlassian.com/contact/#/) which got resolved very quickly.


Tags: bitbucket-cloud

cloud
How do I clear the composer cache?
Asked by Nathan Bennett:

We are seeing an issue where composer is not properly installing a package, and subsequently the class is not available after deployment, causing errors.

Is there a way to clear the compser cache via the BitBucket admin?


Answers:
author: Theodora Boudale
body: Hi Nathan,

Yes, it is possible to clear caches manually. You can go to this repo's page on Bitbucket website, then to Pipelines for this repo, and on the top right corner of the page that lists all Pipelines builds you'll see a link named **Caches**. If you select that, you will see all caches for this repo. Hover over the cache you want to delete, and you'll see a trash icon next to it that you can use to delete it.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cache

cloud

composer
Where is Merge Check
Asked by Lydia Lazzaro:

from the website says Bitbucket Data Center and Server comes with some default merge checks.

<https://confluence.atlassian.com/bitbucketserver059/checks-for-merging-pull-requests-949254992.html#Checksformergingpullrequests-Defaultmergechecks>

Is the also available for the Bitbucket Cloud? We are on the Premium plan but can't seem to find the Merge Check feature from the project settings. If anyone can help that will be great.

There is a Branch restrictions option but there are some features are only available for the Premium. My company is on Premium plan but these features are still disabled. Any steps to enable them when switch from regular to Premium?

![Screen Shot 2022-09-08 at 11.52.10 AM.png](/t5/image/serverpage/image-id/215044i1512F6AF1DBA736D/image-size/large?v=v2&px=999 "Screen Shot 2022-09-08 at 11.52.10 AM.png")

Thanks,

Lydia


Answers:
author: Syahrul
body: Hi [@Lydia Lazzaro](/t5/user/viewprofilepage/user-id/5026519)

Welcome to the community.

It's an entirely different product between Bitbucket cloud and Bitbucket server. However, we do have a merge check feature that has an almost identical feature. Please check our KB below to find out more:

* [Bitbucket cloud Merge check](https://support.atlassian.com/bitbucket-cloud/docs/suggest-or-require-checks-before-a-merge/)

With that said, if your Bitbucket Workspace is on the Premium plan, the screenshot you share should have the option enabled by default. If it's disabled, the repository may not be in your Premium Workspace. So if it's okay, can you share with me the Repo URL so I can verify it?

Cheers,  
Syahrul

comments: author: Lydia Lazzaro
body: Hello Syahrul,

Those options show-up after-awhile. Thank you so much for getting back to me.

Lydia


Tags: bitbucket-cloud

cloud
Branching model - multiple development branch
Asked by Qibin Tan:

In Bitbucket data center, can we specify multiple development branches in the branching model so that we can have the automatic merging from one release branch into these development branches?  

Thanks


Answers:
author: Mikael Sandberg
body: The short answer is no, you cannot have multiple development branches defined in Bitbucket. Git only supports a single development branch.


Tags: bitbucket-server

server
I got this error: Someone has already added that key as an access key to a repository.
Asked by Mark:

I don't know how can i find the repository where I added this key. Could you please tell me the solution to fix it?


Answers:
author: Caroline R
body: Hi, [@Mark](/t5/user/viewprofilepage/user-id/4991306), welcome to Atlassian Community!

As we will need to know the public ssh key to further investigate this case, I have created an internal ticket for you using the email of your community account, so you don't have to share this information here.

You should have received an email with a link to the support ticket. Just in case you haven't received it, please feel free to let me know and I can post the ticket URL here. The ticket will be visible only to you and Atlassian staff, no one else can view its contents even if they have the URL.

Please feel free to let me know if you have any questions.

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud
How do I display conflicts in a pull request?
Asked by jmeyns:

I used to be able to look at merge conflicts when looking at a pull request on the web surface. Where did this feature go?


Answers:
author: Theodora Boudale
body: Hi [@jmeyns](/t5/user/viewprofilepage/user-id/5026045),

We have changed the diff algorithm we use in pull requests to improve performance on complex diffs, you can check for more details here:

<https://bitbucket.org/blog/improving-performance-on-complex-diffs>

The new algorithm we use does not reflect changes made to the destination branch since the source branch was created from the destination branch, it will show only the changes introduced in the source branch. This is the reason why conflicts cannot be displayed on our website anymore.

We have a request to provide the previous preview-merge diff type on demand that you can vote for if you'd be interested in that (this diff would show conflicts as well):

* <https://jira.atlassian.com/browse/BCLOUD-21964>

Kind regards,  
Theodora

comments: author: jmeyns
body: Thank you for clearing things up for me.

All the best,

Jan Meyns


Tags: bitbucket-cloud

cloud
Retrieve the user's avatar via the REST API endpoints is returning a wrong avatar
Asked by Kim Aharfi:

I've being trying a lot of endpoint, and check the links.avatar.href on them  

GET /2.0/user  
GET /2.0/users/{selected_user}  
GET /2.0/repositories/{workspace}/{repo_slug}/commit/{commit}  
GET /2.0/repositories/{workspace}/{repo_slug}/commits  

all of them return the default initial avatar image and not the updated atlassian image.  
I have found that the site is using   

<https://id.atlassian.com/gateway/api/me>  

to get the right avatar image, but Im doing it for bitbucket integration and my users only have a bitbucket authentication.  

btw, this is just one blocker of many more I have on bitbucket api. (cannot get a user by mail or email, cannot get user account id from any request to get a user, cannot authenticate with bearer that used to worked, cloning repo sometime not include the previous push and take time to get update it), being succes to have a workaround for for every one of them but this one is a main blocker for me and my company


Answers:
author: Syahrul
body: Hey [@Kim Aharfi](/t5/user/viewprofilepage/user-id/5026036)

Welcome to the community.

By default, the endpoint follows the user Atlassian account configuration. If the user allows their profile to be public, then the avatar will be exposed in the API endpoint.

It's under [Profile and visibility](https://id.atlassian.com/manage-profile/profile-and-visibility). You can configure who can see your profile picture (avatar). If it's configured public (anyone), it will return the user avatar in the Bitbucket API endpoint.

I hope this helps, and feel free to create new community questions for any of the blockers you have. We'd be happy to help.

Cheers,  
Syahrul

comments: author: Kim Aharfi
body: thank you [@Syahrul](/t5/user/viewprofilepage/user-id/744536) it is helpful!  
another question I asked here is how can I get from name or email the uuid? I had to go throw   
GET /2.0/repositories/{workspace}/{repo_slug}/commits endpoint and search for the user?  


author: Syahrul
body: Hey [@Kim Aharfi](/t5/user/viewprofilepage/user-id/5026036)

I'm glad to hear that help!

I believe the following API endpoint should get the user name and UUID:

* [List users in Workspace](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-members-get)

However, we currently do not expose user email addresses in our API endpoint, so I believe you can only get the user name and UUID at this moment.

Cheers,  
Syahrul


Tags: bitbucket-cloud

cloud
Using bitbucket pipelines pipes with arrays and loops
Asked by Kelly:

Im looking at creating a pipes repo which can call other repositories and deploy to specific environments of which we have many (multiple dev and test environments).

The intention of this is to have a single repo where a user can select an envionrment, and it would then go deploy the master branch of all repositories in its list to that environment.

Ive like to avoid having too much duplication of code and ideally be able to just iterate over a list of either the environments, or the repositories.

Is there any documentation on examples someone can point me to if this is even possible?

thanks


Answers:
author: NathanielG
body: Loops are certainly possible in bitbucket-pipelines.yml, though I don't think you can call a pipe from within, which is what I am looking for...

script:  
- VERSIONS=\`\\ls versions\`  
- \>  
for v in $VERSIONS; do  
if \[ "$BITBUCKET_BRANCH" == "release" \]; then  
version=$v ;  
else  
version="${BITBUCKET_BRANCH}-$v" ;  
fi

- echo $version # Do what you need to here ;

done


author: Ben
body: Hey Kelly,

Figured I would jump in as I have noticed that no one has yet replied.

Arrays/loops are not supported in Bitbucket Cloud Pipelines YML config, to use arrays/loops you would need to execute a bash script for this. We cannot provide specific assistance with scripting as this falls outside of our support scope.

Cheers!

- Ben (Bitbucket Cloud Support)


Tags: bitbucket-cloud

cloud
How to invite (not manually) and restrict domain-specific invites on bitbucket
Asked by Sherly Fratista:

Question: Do we have to invite 1 per 1 user on bitbucket? how to maintain the existing user id? (How to restrict).

Goals: We want emails contained in azure AD to be accessible on bitbucket.

Constraints: what kind of flow for the best solution, if there are developers who need access to bitbucket? Because there are 70 of them (manual invites are not efficient). How to invite them and prevent outsiders from accessing the azure AD repository.


Answers:
author: Theodora Boudale
body: Hi Sherly,

Bitbucket Cloud doesn't support provisioning users from an external directory at the moment. This feature is in our roadmap for 2023:

* [https://www.atlassian.com/roadmap/cloud?selectedProduct=bitbucket\&search=user%20provisioning](https://www.atlassian.com/roadmap/cloud?selectedProduct=bitbucket&search=user%20provisioning)

It is tracked in the following ticket in our issue tracker (you can add yourself as a watcher if you'd like to get notified via email on updates):

* <https://jira.atlassian.com/browse/ACCESS-621>

<br />

In the meantime, if you invite users from the website, you need to invite them one at a time. We have API endpoints to issue an invitation as well:

For inviting a user to a certain repository only <https://support.atlassian.com/bitbucket-cloud/docs/invitations-endpoint/>

For inviting a user to a workspace's user group <https://support.atlassian.com/bitbucket-cloud/docs/invitations-resource/>

You would still need to provide each member's email address even with API calls.

<br />

Restricting user invitations to a specific domain only is also not possible at the moment, however, this is also something that we are working to add. You can add yourself as a watcher to the following ticket if you'd like to get notified via email on updates: <https://jira.atlassian.com/browse/BCLOUD-19685>

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
How to add default reviewers and merge strategies to a Project with the REST API
Asked by Stuart:

Hi there,  

Trying to work out how to specify a merge strategy and add default reviewers at the Project Level in BB Cloud, using the REST API.  

I know how to do these at the Repository level, but I would prefer to set this at a project level, so that existing and new repositories can simply inherit these settings.

I have looked through the Rest API documentation, but the actions available at the Project level seem fairly light-on in this regard.  

Am I missing something ?  

Thanks.


Answers:
author: Theodora Boudale
body: Hi Stuart,

I'm afraid that it is not possible to do this with the API at the moment, you can only set those from our website.

I can create a feature request to add this functionality in our API as well, please feel free to let me know if you'd like me to proceed with that.

Kind regards,  
Theodora

comments: author: Stuart
body: Hi Theodora,  

Thanks for the clarification.  

I feel this would be a great feature to add into the API's capabilities, and would go towards a team being able to define more of their Bitbucket environment in code, leading to guaranteed, repeatable steps, and not needing to use the front end environment to configure some aspects if a new project is required.  

Therefore if it could be raised as a feature request into the main product, that would be great.  

Thanks.


author: Theodora Boudale
body: Hi Stuart,

Of course, I went ahead and raised a ticket for each issue:

* <https://jira.atlassian.com/browse/BCLOUD-22136>
* <https://jira.atlassian.com/browse/BCLOUD-22137>

I would recommend adding your vote to both (by selecting the **Vote for this issue** link in each one) 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](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) and any updates will be posted in the feature requests.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Bitbucket not loading correctly on Chrome
Asked by Tejvir Singh:

Hi,

We are currently using Bitbucket data center product and for one user on their Windows machine we are seeing that bitbucket is not loading correctly. Some icons or tabs are not loading properly and those things are left empty. I am assuming this is mostly a CSS issue where those scripts are not loading properly.

Is there a fix that we can try on Chrome?

Thanks

Tejvir Singh


Answers:
author: Tejvir Singh
body: Hi Tinas,

This issue was fixed by clearing the cache on the chrome browser and making sure it was the latest build version.

Please try that and let me know if that does not work still.

Thanks

Tejvir Singh


author: tinas
body: ++I have tried few methods to fix this issue but it didn['](https://www.growthtakeover.com)t work out?++

++Hopefully some support team will help us.++


Tags: bitbucket-server

chrome

server
Not receiving member invitation to workspace or repos
Asked by Ana de Oliveira:

The workspace admin sent an invite prior to the activation of my email inbox. He resent it after the activation of the inbox, but I still I did not receive the workspace invite. A team member tried to manually add me to several repos, but still no success. No invites from Atlassian are coming through in my inbox.

I contacted Atlassian support, but still haven't got a response. I need this asap, since I cannot work without access to Bitbucket.


Answers:
author: Daniel Eads
body: Hi [@Ana de Oliveira](/t5/user/viewprofilepage/user-id/5025656) , welcome to the Community.

On 2022-08-30, our mail service logged an error from your company's mail server that your mailbox didn't exist. This frequently happens with gmail - if the mailbox is created and the Atlassian invitation is sent immediately (or even before the mailbox is created), Google will return an error to our mail service. It takes some measure of minutes for the mailbox to be created and ready to receive mail.

I've cleared out the error in our mail service. A new invitation will need to be sent by the workspace admin and/or repo admins.

Cheers,

Daniel \| Atlassian Team

comments: author: Ana de Oliveira
body: Thank you Daniel!

The invitation was resent and successfully received.

Ana


Tags: bitbucket-cloud

cloud
pipeline variable
Asked by Joan Arbelaez:

adding my default variable "BITBUCKET_TAG" to my "aws-ecr-push-image:1.6.0" I did it this way but it doesn't work

AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID  
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY  
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION  
IMAGE_NAME: my-docker-image  
TAGS: '${BITBUCKET_TAG}'

any suggestion?


Answers:
author: Igor Stoyanov
body: [@Joan Arbelaez](/t5/user/viewprofilepage/user-id/5009568) hi. Thanks for your question.  

Please provide us more details with your pipeline config and response to understand what is going wrong.

Also take a look at the[description of the](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/)[BITBUCKET_TAG variable](https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/):

*"The tag of a commit that kicked off the build. This value is only available on tags.*

*Not available for builds against branches."*

<br />

Regards, Igor.

comments: author: Joan Arbelaez
body: adding my default variable "BITBUCKET_TAG" to my "aws-ecr-push-image:1.6.0" I did it this way but it doesn't work, it returns empty value " "

AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID  
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY  
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION  
IMAGE_NAME: my-docker-image  
TAGS: '${BITBUCKET_TAG}'


author: Joan Arbelaez
body: Patrick I am effectively calling the variable from a branch, so I am going to do it directly from the label to obtain the corresponding value as you indicate, thanks for your answer


Tags: aws

bitbucket-cloud

cloud
Request for run the Garbage Collection
Asked by KOLYAS:

Hello, I need to run GC because my repository get 3.4 GB

I run this command before:

java -jar bfg.jar --strip-blobs-bigger-than 50M some-big-repo.git  
cd repo  
git reflog expire --expire=now --all \&\& git gc --prune=now --aggressive  
git push


Answers:
author: Caroline R
body: Hi, [@KOLYAS](/t5/user/viewprofilepage/user-id/2813304), thank you for reaching out to Atlassian Community.

I ran the GC against your repository and managed to reduce its size.

I also would like to share with you that we have a feature request to allow users to mark repositories for git GC, as you can check here:

* <https://jira.atlassian.com/browse/BCLOUD-11593>

Please consider adding yourself as a watcher to receive the updates as we make progress with this. If you are not familiar with our Feature Request Policy, you can read more about it [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html).

Feel free to share any additional questions or concerns regarding this case.

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud
pipes inside a miltiline script in Bitbucket Pipeline
Asked by Agastya Bisht:

Hi  

I was trying to run a pipe based on a specific condition in the script. The condition is multiline scripts.  
I want to implement something like the below but I am getting errors. Please guide.  

```
script:
   - >- if [ "$Var" = True ]; then
            - pipe: atlassian/aws-code-deploy:1.1.1
                variables:
                       <A>
         fi
   - >- if [ "$Var" = False ]; then
            - pipe: atlassian/aws-code-deploy:1.1.1
                variables:
                       <B>
         fi
```


Answers:
author: Patrik S
body: Hello [@Agastya Bisht](/t5/user/viewprofilepage/user-id/5025172) ,

Welcome to Atlassian Community!

I'm afraid it's currently not possible to condition the execution of pipes in Bitbucket Pipelines, as bash does not recognize the "pipe" as a valid command. We have a feature request to implement that functionality, which you can check in the following link :

* <https://jira.atlassian.com/browse/BCLOUD-20555>

I would suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with [this policy](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) in mind.

While this feature is not implemented, one workaround I can think of is separating the conditions into multiple steps, and finishing the step early with an exit 0 in case the condition is not met. Please refer to the example below :

```
image: atlassian/default-image:3
pipelines:
  default:
    - step: 
       name: "Execute when the variable is true"
       script: 
         - if [ "$VAR" != true ]; then exit 0 ; fi # Finish the step if the $VAR value is not true
         - pipe: atlassian/aws-code-deploy:1.1.1 
           variables: <A>

    - step: 
       name: "Execute when the variable is false"
       script: 
         - if [ "$VAR" != false ]; then exit 0 ; fi # Finish the step if the $VAR value is not false
         - pipe: atlassian/aws-code-deploy:1.1.1 
           variables: <B>
```

Hope that helps! Let me know in case you have any questions.

Thank you, [@Agastya Bisht](/t5/user/viewprofilepage/user-id/5025172) .

Kind regards,

Patrik S


author: Agastya Bisht
body: Thank you, Patrik  
Your provided solution worked for me.


Tags: bitbucket-cloud

bitbucket-pipelines

cloud