youngmon/atlassian-qna huggingface dataset:
Get branch details
Asked by Yogesh Mude:

How do I get the branch name and last commit date using a groovy script?


Answers:
author: Robert Giddings [Adaptavist]
body: Hi [@Yogesh Mude](/t5/user/viewprofilepage/user-id/3551575) ,

Please can you tell me how you are using this groovy script?

Is it as a Pre Hook or Merge Check, for example? Or a script you want to run in the Console?

I ask, because knowing where and how the script will be run will affect the script example I can provide you.

Thanks,

Robert Giddings,

Product Manager, ScriptRunner for Bitbucket

comments: author: Yogesh Mude
body: Hello, [@Robert Giddings \[Adaptavist\]](/t5/user/viewprofilepage/user-id/1196283) ,

Thanks for the time and response.

Actually, we have a requirement like every Friday or once in a week bitbucket should send an email listing all **open branches.**

So for this, I checked in Script Runner there is a Jobs (ie. Schedule Custom Email) using which I can send an email based on the interval.

So here I need to write a script where I can get all detail like Project Name, Open branch Name, Last commit date, Has open pull request or not, etc..

Can you guide me or provide me any previous script for assistance.

Regards,

Yogesh


author: Robert Giddings [Adaptavist]
body: Hi [@Yogesh Mude](/t5/user/viewprofilepage/user-id/3551575) ,

If you look at this Community post (<https://community.atlassian.com/t5/Adaptavist-questions/Scriptrunner-list-of-tags/qaq-p/1376193>) it has a Script on it, that reports on all tags belonging to a repository using the

```
com.atlassian.bitbucket.repository.RefService.getTags()
```

method.

You could use that Script as a basis, but instead you would want to use the

```
com.atlassian.bitbucket.repository.RefService.getBranches()
```

method. The results of which contain the last commit.

Here is the JavaDoc with the details of RefService: <https://docs.atlassian.com/bitbucket-server/javadoc/6.9.0/api/com/atlassian/bitbucket/repository/RefService.html>

Also, you will also want to use the PullRequestService in order to search for open Pull Requests.

Here is the JavaDoc with the details of the PullRequestService: <https://docs.atlassian.com/bitbucket-server/javadoc/6.9.0/api/com/atlassian/bitbucket/pull/PullRequestService.html>

Please let me know if you require any more help?

Kind regards,

Robert Giddings,

Product Manager, ScriptRunner for Bitbucket


Tags: adaptavist

bitbucket-administration

bitbucket-server

branch

script

scriptrunner

server
I can't operate the browser
Asked by PRIPRESS ISHIYA:

When I access Bitbucket?<https://bitbucket.org/dashboard/overview?> on my browser, it stays loaded and I can't operate it.

Even if I try it with different browsers of chrome, firefox and safari, they are all in the same state.

However, if i use a different PC, i can access it without any problems.

![????????? 2020-10-27 14.43.03.png](/t5/image/serverpage/image-id/115781i02E28D3C34591F6C/image-dimensions/562x277?v=v2 "????????? 2020-10-27 14.43.03.png")


Answers:
author: Prince Nyeche
body: Hi [@PRIPRESS ISHIYA](/t5/user/viewprofilepage/user-id/2329778)

Welcome to community. have you tried using Incognito browser mode? Probably you might have an extension that might be blocking some scripts on bitbucket. Try incognito mode and see if you get the same result or if the result is the same?
How to do cherry pick commitId in Pull Request
Asked by Surya Bera:

While creating Pull Request from one branch to another how to select specific commitId?


Answers:
author: Mikael Sandberg
body: You cannot do a cherry pick when creating a pull request, it will aways take all changes on the source branch. If you want to do a pull request with cherry pick you would first have to create a new branch and cherry pick on that branch and then create a pull request with that new branch as the source.
Large repository - deleting large file increases repo size.
Asked by Ram Sundaram:

I used git_find_big.sh file to file the biggest files

And I identified one file that is very old and can be safely deleted and ran the command below

git filter-branch --index-filter 'git rm --cached --ignore-unmatch GradeBrains/Pods/HockeySDK/HockeySDK-iOS/HockeySDK.embeddedframework/HockeySDK.framework/HockeySDK' HEAD

After i rewrote the history - i tried to push - it showed a lot of items to pull in source tree and push failed.

When I pulled and pushed - the repo size is now at 1.89 GB

In my local - it is still showing the file as not deleted.

Can u help suggest some possible way out.


Answers:
author: Theodora Boudale
body: Hi Ram,

You are right that when you rewrite history and push to the Bitbucket repo, a git gc is needed on the remote repo for the old references to get removed and for the repo's size to get reduced.

I see that you opened a support ticket as well and got assistance for this issue.

Just wanted to double check with you and see if you need anything further on this?

I also wanted to mention, for any other users who may come across your question, for a git gc on a repo you can create a support ticket via <https://support.atlassian.com/contact/#/>, in "What can we help you with?" select "Technical issues and bugs" and then Bitbucket Cloud as product.

Kind regards,  
Theodora


author: Ram Sundaram
body: Based on various threads - I did realize that i should force the push if i used filter index.

I also tried this and ended up making the repo 2.05 GB. So I ran out of options here.

Is there a way to delete the files and bring the repo below 1GB.

In my local it is only 940 MB.

du -hs .git/objects  
940M .git/objects

git count-objects -Hv  
count: 0  
size: 0 bytes  
in-pack: 151371  
packs: 2  
size-pack: 936.56 MiB  
prune-packable: 0  
garbage: 0  
size-garbage: 0 bytes

Will running GC on server side fix the issue?


Tags: bitbucket-cloud

cloud
Integrate Bitbucket with CodePipeline
Asked by SBGGroup:

Hi All,

Is it possible ho to integrate bitbucket data centre with AWS CodePipeline.

What would be a starting point?

Thanks,

Barry


Answers:
author: Steffen Opel _Utoolity_
body: Hi [@SBGGroup](/t5/user/viewprofilepage/user-id/1176996) ,

AWS provides an (unsupported) starting point to integrate Bitbucket Server and Data Center by means of a custom webhooks based solution that is provisioned via a CloudFormation stack - I managed to get it to work back then, but haven't used it for a while (the repository seems to receive basic maintenance at least):

* Blog: [Integrating CodePipeline with on-premises Bitbucket Server](https://aws.amazon.com/blogs/devops/integrating-codepipeline-with-on-premises-bitbucket-server/)
* Source: [aws-codepipeline-bitbucket-integration](https://github.com/aws-samples/aws-codepipeline-bitbucket-integration)

Cheers,  
Steffen


Tags: aws-code

bitbucket-server

server
how to down load new-liquidcrystal zip
Asked by visudda sampath hewakandamby:

<https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/>

trying to down load a zip from above link .

getting 'import has failed ' every time

1. 09:24:19 git import for: <https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/>
2. 09:24:20 Cloning <https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/>...
3. 09:24:20 Cloning into bare repository 'Visudda/francisco-new-liquidcrystal'...
4. 09:24:20 remote: Repository fmalpartida/new-liquidcrystal not found
5. 09:24:20 fatal: repository 'https://visudda@bitbucket.org/fmalpartida/new-liquidcrystal/downloads/' not found
6. 09:24:20 Remote Git clone failed: \<class 'bitbucket.apps.asyncx.tasks.ImportException'\>: Command failed. Return value: 128


Answers:
author: Theodora Boudale
body: Hello,

I was wondering if you could give us some more details on what exactly you are trying to do, as I am a bit confused with the description of the issue. You mention trying to download a zip from <https://bitbucket.org/fmalpartida/new-liquidcrystal/downloads/>, however the output you copy-pasted looks to be output from an **Import** operation instead.

Additionally, when I try to access the URL <https://bitbucket.org/fmalpartida/new-liquidcrystal/>, I see that such a repository does not exist, I get a 404 error.

Was this link given to you by the owner of the workspace <https://bitbucket.org/fmalpartida/>? Do you know the owner, and can you double check with them whether they have deleted or renamed the repo?

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Authentication failed from cloning private repository in jenkins
Asked by Neeraj Paliwal:

I will fetching public repository in jenkins using ssh keys. But unable to fetch private repository in jenkins using Access keys.


Answers:
author: Theodora Boudale
body: Hi Neeraj and welcome to the community.

Could you please let me know:

* What is the URL of the repo you have issues with?
* What is the public SSH key you have added to the repo?
* What is the output of the failed clone command? Are there any logs in Jenkins showing errors that you can share here?

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
remove a file in master branch
Asked by adtyh jkipmsd:

Hello,

i use ubuntu and i install git for push my script on bitbicket.  
i pushed a file in branch master but now i want to delete this file, the problem is i don't know how to do that, i use this command but not work:

```
git rm test.vmware.yaml
```

thanks for any information,


Answers:
author: Ana Retamal
body: Hi [@adtyh jkipmsd](/t5/user/viewprofilepage/user-id/4070606), thanks for reaching out!

First of all, please note that this is not a Bitbucket specific question, this is a question specific to Git. That said, I'll still try to help you but you might also like to know that there are other multiple forums where you can find help and information regarding this system :)

The command you pasted above is only one command from the sequence of commands you need to make the operation effective. The removal would go something like this:

```
git rm <directory>
git commit -m "Removed Directory"
git push origin master
```

Once you push the change (the removal of the file/s) the operation will be completed and the file/s deleted. If the operation is not successful, you should receive some kind of error. If you do, please let us know and share here the error message so we can look into it.

For additional information, you can also read [Git's official documentation](https://git-scm.com/docs/git-rm).

Hope that helps!

Ana


Tags: bitbucket-server

git

server
cherry pick command issue
Asked by yogita.jagdale:

Hi,  

After doing cherry-pick we have faced the issue where xxxx vanilla fix was not applied at correct place in BNETS source code.  

Please find attached screenshot of source code which went wrong after cherry-pick.  

From line number 13501y00 to 13501y00 fix should get applied after 13501u0A. But it got applied after the CSM line due to which transaction processing got impacted in production and as compared with parameter table and case condition it got misplaced.  

For your reference please find attached source file of BNETS. Kindly check line number 12676y00, 13501u0A and 13501y00.

snap1:

![snap1.png](https://community.atlassian.com/t5/image/serverpage/image-id/115582iD71817B3700C993C/image-dimensions/566x224?v=v2 "snap1.png")![snap2.png](https://community.atlassian.com/t5/image/serverpage/image-id/115581iDF25D4256CE22205/image-dimensions/490x236?v=v2 "snap2.png")  


Answers:
author: rsbeckerca
body: In the past month, we have experienced a similar line move in one file in our own code. This appears to have happened during the MERGE SQUASH function when a PULL REQUEST was merged. The code was fine in the topic branch created by Jira but after the squash, the first line of one merge block was incorrectly located. Sadly, the branch is gone and we cannot see the commit log from that branch. The file has 6700 lines and the problem occurred in the middle. We did not notice because the line that was moved was effectively a no-op, otherwise it would have shown up in regression testing. The situation occurred 17 Nov 2020 and went unnoticed until today. Note that we cannot prove 100% that this was not a developer issue rather than a BitBucket issue. We find the timeframe (that it occurred near when the OP encountered this) to be interesting. What version of git was being used at BitBucket Cloud at that time? For the OP, what version of git was on your BitBucket install at that time?


Tags: bitbucket-server

server
I want to upgrade my bitbucket server installation.
Asked by Alparslan Ozturk:

Hi,

I have installed the bitbucket server with this file (atlassian-bitbucket-6.6.2-x64.bin) now I am trying to upgrade with this file (atlassian-bitbucket-7.7.0.tar.gz). I have download files and extracet and checked from UI.

how can I complete upgarde processs?


Answers:
author: Stephen Garber
body: Atlassian has a full guide on updating bitbucket here: <https://confluence.atlassian.com/bitbucketserver/bitbucket-server-upgrade-guide-776640551.html>

At a high level here are the steps:

1) Download and unzip the new package

2) Stop old installation

3) Migration customizations from old to new package (including home directory location)

4) Start the new bitbucket application

Once the new version has been started bitbucket will automatically upgrade the database.


Tags: bitbucket-server

server
Container 'Build' exceeded memory limit. NodeJS.
Asked by Aidan:

Local ng test is fine (runs in about 30 secs).

I've tried expanding the docker memory to 3072 but that didn't work.

Project is NodeJS, trying to test using Karma and ChromeHeadless.

Already using flags: \['--no-sandbox', '--disable-gpu'\]

Rerunning the last working pipeline also fails now.

My pipelines YML for reference:

```

image: node:10.15.3

pipelines:
  default:
    - step:
        name: Build and Test
        caches:
          - node
        script:
          - apt-get update && apt-get install -yq libgconf-2-4
          - >
            apt-get update && apt-get install -y wget --no-install-recommends && \
              wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add -  && \
              sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' && \              apt-get update && \
              apt-get install -y google-chrome-unstable fonts-ipafont-gothic fonts-wqy-zenhei fonts-thai-tlwg fonts-kacst ttf-freefont --no-install-recommends
          - npm install
          - npm test
        artifacts:
          - dist/**?
```


Answers:
author: Theodora Boudale
body: Hi Aidan,

I see in the pipelines yml file you attached here that you are not using any services. In this case, each step has 4096 MB of memory in total. I'm not sure where you set the memory to 3072?

If the build needs more than 4GB of memory to run, then the suggestion I can make would be to use size: 2x for the step (you can check here the documentation: <https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/>). With this option, the build will have double the resources available (so 8 GB of memory), but it will also consume twice the number of build minutes.

You mentioned that the build was working before. I have seen a similar issue reported recently, where the builds started failing due to memory issues when HeadlessChrome 88.0.4298 was used, while previous builds, using HeadlessChrome 88.0.4292, were successful. Could this be the case with your builds as well?

Kind regards,  
Theodora

comments: author: Aidan
body: Hi Theodora,

I did add a service in to adjust the step memory but removed it again when it did not work. Trying size: 2x also did not work.

Definitely seems to be an issue with the latest unstable HeadlessChrome release. Switching over to stable has fixed everything. Thanks for the tip!


author: Theodora Boudale
body: You're welcome [@Aidan](/t5/user/viewprofilepage/user-id/3698513) , good to hear this helped resolve the issue!


Tags: bitbucket-pipelines

bitbucket-cloud

cloud
Bitbucket is on a separate invoice
Asked by Alberto Cerqueira:

Good afternoon.

My bitbucket organization is being charged separately from Atlassian, how can I join and receive only one invoice?

![Captura de tela de 2020-10-25 15-04-31.png](https://community.atlassian.com/t5/image/serverpage/image-id/115572i4EC828C6D5C4AA87/image-size/large?v=v2&px=999 "Captura de tela de 2020-10-25 15-04-31.png")


Answers:
author: david_aerts_dna
body: 2 hours I spent trying to figure out why I could not see my bitbucket invoices under billing. It is late and I am doing my accounting. It is so frustrating having to look around that much. The UI should guide us and, if there are (historical ?) reasons to have them separated, so be it, but there should be some kind of guidance to the invoices. So far - and without having to read this community post, and using the link from above - I still cannot find how to access the bitbucket invoices... this drive me crazy...


author: Theodora Boudale
body: Hi Alberto,

I'm afraid that at the moment this is not possible, the invoice for Bitbucket Cloud is separate than the ones for other Cloud products.

It has been requested from many customers though to have a centralized billing system and one invoice for all Cloud products. We have the following feature request regarding this in our issue tracker:

* <https://jira.atlassian.com/browse/CLOUD-10970>

I would suggest adding yourself as a watcher (by selecting the **Start watching this issue** link) if you'd like to get notified via email on updates. When there is an update on this, it will be posted in this public feature request.

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

Kind regards,  
Theodora

comments: author: Alberto Cerqueira
body: Good Morning.

How do I pass the access to invoices from one Bitbucket account to another account, without having to migrate all projects and repositories?

Both are within the same organization, but access to invoices is made only by the organization's creator and the organization should no longer be part of our team.


author: Theodora Boudale
body: Hi Alberto,

The invoices are accessible to the billing contacts of the Bitbucket Cloud license at <https://my.atlassian.com/billing/paidorders>.

If you are a billing contact for this license, then you can:

1. Log in to <https://my.atlassian.com/>
2. In the listed licenses, find the one for the Bitbucket Cloud workspace you are interested in and select it to expand its details
3. In the license details, you will see a field **Billing Contacts**. In there, you can add the email of the user you want to pass the invoices to
4. If you want this person to become the main billing contact, then this person will need to log in to <https://my.atlassian.com/>, find their email listed as billing contact for the license, and select the link **Make Primary** next to it

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

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Git 2.28 cannot connect
Asked by Matthew Aguirre:

After updating to Fedora 33 and using git 2.28, I get the following

My bitbucket server works fine using Fedora 32, CentOS 8, and Ubuntu 20.04.1 LTS

Setting and generating new ssh keys did not help. I can check out with https, but do not want to.

Cloning into 'portal-grails'...  
git@git.xxxx.com: Permission denied (publickey).  
fatal: Could not read from remote repository.

Please make sure you have the correct access rights  
and the repository exists.


Answers:
author: Mark McIntyre
body: Follow the thread here for some insight into the problem:  
<https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/QCZHTG2BHF4LJSSK2OQUCWEXJV4BVODX/#2UT63ST4JARKZIENTKROMBVC6RUPRYEF>

The solution for me ended up being adding this to my **.ssh/config** file:

```
## Bitbucket
Host bitbucket.org
? ? PubkeyAcceptedKeyTypes +rsa-sha2-256,rsa-sha2-512
```

comments: author: zenharbinger
body: Yep, I something similar (possibly exactly) to this which worked.

Thanks!

It was frustrating that it would work with my other distros, but not w/ Fedora 33.

All using the same .ssh info.


author: shantanucse18
body: You can also use ssh param before git clone like following

```
GIT_SSH_COMMAND='ssh -oPubkeyAcceptedKeyTypes=+ssh-rsa' git clone git@bitbucket.org:whateverproject/somerepo.git
```


Tags: git

bitbucket-server

jira-software

jira-software-server

server
Why 15? I have only ONE user!
Asked by SergiiM:

The proposition was 3$ pro user. I am using the account alone, only 1 user. Why should I pay 15$?


Answers:
author: Brant Schroeder
body: Sergii,

I would suggest that you use the free plan if you only have one user. 1-5 users is the same price for standard plan but you can always use the free option. You can also upgrade from the free to standard or premium at anytime.


Tags: bitbucket-pipelines
Pipeline service, redis custom config file
Asked by hemendra chaudhary:

How do I run a simple Redis datastore in the pipeline with a custom config file?

I want to test the keyspace notification in my test cases.

```
version: "3"

services: 
  redis: 
    image: redis 
    command: redis-server /usr/local/etc/redis/redis.conf 
    volumes: 
      - ./redis.conf:/usr/local/etc/redis/redis.conf


```

```


set?config set notify-keyspace-events "EKx"
```


Answers:
author: Theodora Boudale
body: Hi [@hemendra chaudhary](/t5/user/viewprofilepage/user-id/82989) ,

You can build a custom redis image with your own config file, and then use this custom image in the Bitbucket Pipelines service definition, instead of using the official one.

You can check:

* <https://hub.docker.com/_/redis>

the section "Additionally, If you want to use your own redis.conf ..."

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Can I choose a workspace on OAuth request?
Asked by Yossi Azoulay:

Hello,   
I'm trying to connect to bitbucket via OAuth 2.0.  
On request (

```
https://bitbucket.org/site/oauth2/authorize?client_id=${BITBUCKET_CLIENT_ID}&response_type=code
```

),  
I'm getting to the "Confirm access to your account" screen.   
Is there a way to choose there the workspace to which I will get access?   
Thanks.


Answers:
author: Theodora Boudale
body: Hi Yossi,

I'm afraid that this is not possible.

When you generate an OAuth consumer, the key and secret are for this specific workspace only, you cannot use them to get access to a different workspace.

For access to a different workspace, a new OAuth consumer needs to be generated and used from this other workspace's Settings.

Kind regards,  
Theodora


author: Yossi Azoulay
body: UP


Tags: bitbucket-cloud

bitbucket-development

cloud

development

jira-development

oauth

permission
(GIT)Check all commits are don in previous release which are present in current release.
Asked by Mahendra M:

How to check if all the commits are done in previous branch (release/10.0.0) are present in the current branch (release/11.0.0) in GIT.


Answers:
author: Stephen Garber
body: You can use the git diff command to show you the difference between the two release branches:

    git diff release/10.0.0..release/11.0.0

Adding three dots instead of two will show this compared to the common parent branch.

    git diff release/10.0.0...release/11.0.0

comments: author: Mahendra M
body: [@Stephen Garber](/t5/user/viewprofilepage/user-id/121970) Thank you for your reply.

I was looking for something like this if i have 100 commits in branch A and if i want to check the commits of branch A in new branch B.

As of now i found the below command which gives branch names where the commit id is present.

git branch --contains \<commit-id\>

This works for single commit id. to check for list of commits then do we any approach ?


Tags: git