youngmon/atlassian-qna huggingface dataset:
Enable merge button post at least two Pull request approvals
Asked by gaurav kumar:

We need to enable the merge button in bit bucket only when the Pull request from any new branch (other than develop, release or master) to another branch is approved by at least two approvers/reviewers.

Please assist if we can implement this for a particular project.

Thanks


Answers:
author: Caroline R
body: Hi, [@gaurav kumar](/t5/user/viewprofilepage/user-id/3692022)!

Thank you for reaching out to Atlassian Community!

Currently, you can suggest or require checks before a merge. **Merge checks** allow you to recommend or require specific conditions (like approvals on a Pull Request) on merges for individual branches or branch patterns.

Providing your users with **recommended checks** to consider before merging is available to everyone. However, **enforce merge checks** is a Premium feature.

In order to set merge checks, you can follow the next steps:

* Go to **Repository settings \>** **Branch permissions**

* Click **Add a branch permission**.

* Select the branch by name or pattern or by type

* In **Write access**, add the users and groups who can push or merge any changes to this branch directly

* In **Merge via pull request**, add the users and groups who can merge to this branch via pull request

* And finally, in the **Merge checks** options, you can select:

  * Check for at least 2 approval

  * Check for at least 2 approval from default reviewers

This way, if someone tries to merge this Pull Request, they will see the following message, but they will still be able to merge the PR:

![Screen Shot 2021-10-06 at 5.30.10 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/163818iB5FE2B243D45A973/image-dimensions/457x469?v=v2 "Screen Shot 2021-10-06 at 5.30.10 PM.png")

To enforce these merge checks (and disable the merge button until they are resolved), you will have to check the "**Prevent a merge with unresolved merge checks** " setting in the branch permission which is only available on the **Premium** plan:

![Screen Shot 2021-10-06 at 5.39.27 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/163821i045C08ED7B2AF0F9/image-dimensions/327x332?v=v2 "Screen Shot 2021-10-06 at 5.39.27 PM.png")

In case you would like to read more about merge checks, you can access the following documentation:

* <https://support.atlassian.com/bitbucket-cloud/docs/suggest-or-require-checks-before-a-merge/>

I hope this information helps, but please feel free to share any additional questions regarding this case.

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud
Can I use CodeInsights without Bitbucket Pipelines?
Asked by Vagif Gafarov:

Hello folks,

<br />

as it is stated in Bitbucket documentation the application Snyk can be used for creating of automatic PRs for update of outdated packages; Snyk requires that you need to have CodeInsights activated for its operation. However, it is not clear whether it needs to have Bitbucket pipelines or I can use CodeInsights without BB pipelines?

can someone clarify this process?

kind regards,

Vagif


Answers:
author: seanaty
body: Anything that can authenticate can use the [reports API](https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/commit/%7Bcommit%7D/reports/%7BreportId%7D) go create reports. While this doesn't have to be done inside of a pipeline it makes the most amount of sense to do so.

I believe authenticating to this API within a Pipeline will "just work". Furthermore, it also makes sense that you'll be wanting to run a report triggered by code changes, a thing that pipelines is good for.

Here are different ways you can authenticate to the Bitbucket API: <https://developer.atlassian.com/bitbucket/api/2/reference/meta/authentication>


Tags: bitbucket-cloud

cloud
Clone only certain folders of a repository
Asked by Gsep Support:

Hello Team,

The Bitbucket repository has over **7gb** data out of which only certain folders are needed (**Around 700mb**).

We would like to clone only the **required files** from the **Bitbucket repository** to avoid downloading excess files and speed up the development process

Can you please help regarding the script or commands that are needed to get only required files to clone from repo.

Thanks,

Siva


Answers:
author: Mikael Sandberg
body: You could do this by using a combination of [git sparse checkout](https://git-scm.com/docs/git-sparse-checkout) and [shallow clone](https://git-scm.com/docs/shallow). Have a look at this thread on how to combine these commands, <https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository/28039894#28039894>

comments: author: Gsep Support
body: The command "git pull --depth=1 origin master" takes hours to complete although the directory which has been selected for clone (through the echo command) is few kb. What might be the reason for this?


Tags: bitbucket-server

server
I want to pass the command for update the max_connections for mysql
Asked by pinals:

I want to increase the size of the max connection pool in MySQL as it has 151 defaults.

while running the integration test cases I need more than that default connection. I have passed the command but seems like it's not working.


Answers:
author: Theodora Boudale
body: Hi [@pinals](/t5/user/viewprofilepage/user-id/4584996) and welcome to the community.

Since you created this question in the Bitbucket Pipelines collection, I assume that you're using a mysql service in Pipelines?

I'm afraid that at the moment it is not possible to pass a command to a Docker service container to modify max_connections.

We have a feature request about this in our issue tracker:

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

If you'd be interested in this, I would suggest that you add your vote in that request (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.

In the meantime, a way to work around this issue would be to create a custom Docker image (based on the official mysql image) that sets your own CMD value, or supports environment variables for settings like these.

Kind regards,  
Theodora


Tags: bitbucket-cloud

bitbucket-pipelines
How can i add custom menu item in Pull request - bitbucket cloud
Asked by Vipin Kumar:

is there any way to add a custom menu item to the pull request menu?.

![Screenshot 2021-10-05 at 1.41.20 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/163470iCEC62ADB0CAAE163/image-size/large?v=v2&px=999 "Screenshot 2021-10-05 at 1.41.20 PM.png")


Answers:
author: seanaty
body: To add an item there you would need to create a Bitbucket Connect App.

This location in particular is a [WebItem](https://developer.atlassian.com/cloud/bitbucket/modules/web-item/) at the location org.bitbucket.pullrequest.summary.actions. With this WebItem you can open up a new page or open up a dialog box whose contents are an iframe.

Learn more here: <https://developer.atlassian.com/cloud/bitbucket/integrating-with-bitbucket-cloud/>


Tags: bitbucket-cloud

button

cloud

menu

pull-request
Not able to merge two branches
Asked by KC-JR:

Hi Team,

We are trying to merge two branches in a repository, where we are getting below issue.

Git failed with a fatal error.  
Git failed with a fatal error.  
fatal: refusing to merge unrelated histories.

The scenario is

We have two repositories kcapp and kcresourceplanning, taken a branch from kcapp and moved to kcresourceplanning. where we already have some branches over there.

But when we are trying merge the branches we are getting above issue.

Can you please look into this and help us.


Answers:
author: Theodora Boudale
body: Hi [@KC-JR](/t5/user/viewprofilepage/user-id/4584386) and welcome to the community.

By default, *git merge* command refuses to merge histories that do not share a common ancestor. If you take a branch from one repository and move it to another repository that is not a fork, this branch will not have a common ancestor with any branch of the repo where you moved it.

It is possible to override this behavior by using the option **--allow-unrelated-histories** in the git merge command. You will need to do the merge locally with a command like the following, and then push to Bitbucket:

```
git merge <branch_name> --allow-unrelated-histories
```

You can find more info about this option on the git merge documentation page, if you search for the option **--allow-unrelated-histories**:

* <https://git-scm.com/docs/git-merge>

If you have any questions, please feel free to let me know.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Is it possible to set collation and charset to MySQL service in Bitbucket Pipeline?
Asked by mullermartin:

I use MySQL database in Bitbucket build pipeline defined like this:

```
definitions:
    services:
        mysql:
            image: mysql:5.7
            variables:
                MYSQL_DATABASE: testbase
                MYSQL_ROOT_PASSWORD: pass
```

But it use wrong (default) charset and collation. I need UTF-8 to get rid of exceptions like:

```
SQLException: Incorrect string value: '\xC5\x88' for column 'city' at row 1
```

Is there a way to fix it in bitbucket-pipelines.yml? In a standard Docker setup I can fix it this way:

```
database:
    image: mysql:5.7
    environment:
        MYSQL_DATABASE: testbase
        MYSQL_ROOT_PASSWORD: pass
    command: [ 'mysqld', '--character-set-server=utf8', '--collation-server=utf8_general_ci' ]
```


Answers:
author: mullermartin
body: In the end, I have used another solution. It seems not possible to create MySQL service in Bitbucket using proper charset \& collation. But it is possible to use SQL script to fix it just on database schema level:

```
alter database my_database_name
    character set utf8
    collate utf8_general_ci;
```

I use the database just for my automated integration tests. So I have set Liquibase to start DB initialization with setting proper charset \& collation.

In case you prefer to do it on table level because you are no allowed to alter whole database schema you can use:

```
create table my_table (...
) character set utf8 collate utf8_general_ci;
```

comments: author: Theodora Boudale
body: Thank you Martin for posting the solution that you used.


author: Theodora Boudale
body: Hi [@mullermartin](/t5/user/viewprofilepage/user-id/2244108),

At the moment I'm afraid that it is not possible to pass a command to a Docker service container, like in the example you included.

We have a feature request about this in our issue tracker:

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

If you'd be interested in this, I would suggest that you add your vote in that request (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.

In the meantime, a way to work around this issue would be to create a custom Docker image (based on the official mysql image) that sets your own CMD value, or supports environment variables for settings like these.

Kind regards,  
Theodora

comments: author: mullermartin
body: Thank you for the link and the solution proposal. I have upvoted the issue.

Regards,

Martin


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

mysql

service
I am unable to find the 'bitbucket.properties' files within my bitbucket_home after setting it?
Asked by Juan Eckert:

I ran set-bitbucket-home.sh and it gave me a directory. When I searched the specified directory, I see no mention of a 'bitbucket.properties' file. I need this to change my repository to private.

This is on a linux server.

Edit: I should add that I am a novice linux user


Answers:
author: Christian Glockner
body: Hi Juan,

Out of the box the file does not exist unless you're using an external database. If you don't have the file in the \<BitbucketHome\>/shared directory you can simply create it.

Cheers,

Christian

Premier Support Engineer

Atlassian


author: John Lawlor
body: Assuming you did a standard install of Bitbucket, your bitbucket.properties file should be in:

```
 /var/atlassian/application-data/bitbucket/shared/
```

You can check the running application with:

```
ps -ef | grep java
```

Then you should see a parameter like :

```
-Dbitbucket.home=/var/atlassian/application-data/bitbucket
```


Tags: bitbucket-server

linux

server
Unable to see pipeline section on bitbucket
Asked by yuri4031:

Hi,

I have multiple repos in my workspace. Recenlty I created a new repo for Android and pushed the code.

But I'm unable to see pipeline section on bitbucket. The loader loads on section and then nothing happens.

I'm using free plan for just testing out this and this includes 50min of build time for a month.

Can anyone help me out what to do?

![Screenshot 2021-10-04 at 4.56.01 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/163315i093D6735CD879003/image-size/large?v=v2&px=999 "Screenshot 2021-10-04 at 4.56.01 PM.png")


Answers:
author: Caroline R
body: Hi, [@yuri4031](/t5/user/viewprofilepage/user-id/4583471)! Welcome to the community!

Could you please confirm if Pipelines is enabled in this repository? In order to check that, you can access **Repository settings** \> under **PIPELINES** section, open **Settings**:

![Screen Shot 2021-10-05 at 4.23.54 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/163607i309D453EE69E5BF3/image-size/large?v=v2&px=999 "Screen Shot 2021-10-05 at 4.23.54 PM.png")

If this is already enabled, you may have been affected by a bug in which the Pipeline wizard no longer appears:

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

If that's the case, as a workaround, you can manually create a bitbucket-peipelines.yml on your main directory and add the following dummy steps to start your first pipeline:

    # This is an example Starter pipeline configuration# Use a skeleton to build, test and deploy using manual and parallel steps# -----# You can specify a custom docker image from Docker Hub as your build environment.image: atlassian/default-image:2pipelines:  default:    - parallel:      - step:          name: 'Build and Test'          script:            - echo "Your build and test goes here..."

Once created, you will be able to select "edit" to see the list of the available templates and you can click on any of them, it will automatically remove the old one and replace it with the template.

Please let me know how it goes and feel free to correct me in case I have misunderstood something here.

Kind regards,  
Caroline

comments: author: yuri4031
body: Hi, it was chrome's issue, maybe because of some plugin/extension.

Ran it on a different browser and now I could see the pipelines page and the relevant settings.

Thanks for your reply.


author: Caroline R
body: Hi, [@yuri4031](/t5/user/viewprofilepage/user-id/4583471)!

Thanks for sharing this information here, I'm glad to know it is working now! :)

Kind regards,  
Caroline


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Pull Request Diff slow scroll after Chrome update
Asked by Alexandra Atanasiu:

Ever since I updated Chrome to 94.0.4606.61, scrolling (mouse wheel) a class which has many changes in the Unified Diff mode is very slow.

I either need to manually use the scrolling bar or another browser (e.g. Firefox) where it works without issues. I am not an isolated case, this happens within my entire team of developers.

This looks related to <https://community.atlassian.com/t5/Jira-Align-questions/slow-scrolling/qaq-p/1815693>, given its recent occurrence in the same Chrome version.


Answers:
author: DrLex0
body: This is fixed in Chrome 94.0.4606.71 or newer.


Tags: bitbucket-server

server
How to specify --recurse-submodules when issuing git-pull?
Asked by Pascal Pfiffner:

Is there an option to have git specify \`--recurse-submodules\` when pulling a parent project? I usually want to pull all the submodules anyway, so this would be very convenient to have if it's not already there.


Answers:
author: KieranA
body: Hi Pascal,

We don't support this option at the moment. You can file feature requests over at [jira.atlassian.com](http://jira.atlassian.com). Project SRCTREE for Mac and SRCTREEWIN for Windows.

Thanks very much


author: Pascal Pfiffner
body: Ok, done, thanks!

<https://jira.atlassian.com/browse/SRCTREE-1708>
Request for demo for sourcetree
Asked by Sanjay Rathod:

Hello

I am new to this software and i have tried so much things with this software but every time i have got error. so can you provide me the demo for the basic functionality of this software.

Thankyou.


Answers:
author: KieranA
body: Hi Sanjay,

What error are you getting? Could you provide us with a screenshot perhaps? Is this for Windows or Mac? If it's for the Mac there's built-in documentation.

Cheers

comments: author: Sanjay Rathod
body: See this Link <http://screencast.com/t/KdySQr3q5tV>


author: KieranA
body: Yes, in SourceTree's preferences could you set your username and e-mail address? Git needs this for your commits.

Cheers
SourceTree: 'Check for Updates' results in an error
Asked by yay:

Using SourceTree 1.0.6 on Windows 7 SP1 x64.

Checking for updates results in the following error message:

'The system cannot find the file specified.'


Answers:
author: yay
body: Weird, it works now. Both when launched from the Start menu and from within the app. So it doesn't always happen.

I didn't change any firewall or router settings, BTW.

Oh, well. It's not a big deal, I guess. Thanks for your responses, guys.


author: stevestreeting
body: Does this happen when you launch Check For Updates from the Start Menu instead of inside the app?

If so, I don't know what this is other than it sounds like the update program can't reach [sourcetreeapp.com](http://sourcetreeapp.com) for some reason. It might be your local firewall settings that are blocking it, please check your settings.

If all else fails, please just download the latest installer from [http://www.sourcetreeapp.com](http://www.sourcetreeapp.com,), which will update your local install when run.


author: KieranA
body: Hi Vitaly,

Are you behind a corporate firewall that's perhaps blocking the update?

Cheers

comments: author: yay
body: Hi Kieran,

No, I am in my home office behind a router, but it never caused a problem.
git global config not working
Asked by Martin Holland:

If I create a new repo and attempt the first commit I get this error..

> \*\*\* Please tell me who you are.
>
> Run
>
> git config --global user.email "you@example.com"
>
> git config --global user.name "Your Name"
>
> to set your account's default identity.
>
> Omit --global to set the identity only in this repository.

however I know the global config is run, and even re-running those commands doesn't fix it. If I run

git config -l

I can see my email and name is already set ok.

It does work though if I omit the --global param and therefore set my email and name explicity for the current repository. So i have to do that every time I create a new repo for it to work.

Am new to git so may have this wrong but assumed that it should be able to pick up the global settings so I don't have to re-tell it my email and name for each repo?


Answers:
author: Martin Holland
body: FYI I fixed this in the end by changing my HOME environment variable. It was set to %UserProfile% which I assume git doesn't like so I changed it to explicity say C:\\Users\\Martin and then it all worked

comments: author: KieranA
body: Thanks for the information, Martin. You may not have been running the same Git instance as the version you use at the command line. As we run Git in a separate process it doesn't honour environment variables like that. I haven't got an instance of the Windows version but I presume there'd be a preference which allows SourceTree to modify your Git/Mercurial settings which may not be set. You can also set your user information (e-mail/username) in there too, usually.

Glad you've got it working otherwise.
clone tagged version
Asked by epataky:

If I want to use Sourcetree/GIT to keep track of source code and documents, and use the tag feature to mark revisions ... suppose now developers commit version 1.0 to the repo .. now day to day they make changes, testers test, etc .. now what if someone wanted to go in and grab the last tagged version, the full set of files corresponding to a specific tag, is this possible? How to do it?


Answers:
author: epataky
body: not sure how to close this .. keep getting emails

comments: author: KieranA
body: You can mark my amended answer above as the answer. Not sure what e-mails you're getting from AAC though?


author: epataky
body: can you at least download the files as they were when they were tagged? There must be a way or else there is no point of tagging .. how about you clone it into another directory, then revert back, will that work?


author: KieranA
body: Hi Ed,

There isn't a feature to *clone* out a specific tag at the moment. You can file feature requests over at [jira.atlassian.com](http://jira.atlassian.com), the project name is SRCTREE or for Windows it's SRCTREEWIN.

Cheers

comments: author: epataky
body: can you at least download the files as they were when they were tagged? There must be a way or else there is no point of tagging .. how about you clone it into another directory, then revert back to the TAG, will that work?


author: KieranA
body: Absolutely! You just double click on a tag and SourceTree will check it out (and prompt you if there's anything in your working copy outstanding).

Hope that helps


author: KieranA
body: Sorry, I meant clone.


author: epataky
body: that's sounds perfect, then why did you say there is no way to check out a tag? i am confused


author: epataky
body: I double clicked, the head was reset, but the files are still the same, showing today's date as modified date .. i need to get an old version ... i need to get a version from a year ago .. how do i do this?


author: KieranA
body: Hi Ed,

There isn't a feature to check out a specific tag at the moment. You can file feature requests over at [jira.atlassian.com](http://jira.atlassian.com), the project name is SRCTREE or for Windows it's SRCTREEWIN.

Cheers