youngmon/atlassian-qna huggingface dataset:
Can't create repo in a bitbucket cloud with curl and access token
Asked by zalman.goldstein:

I am trying to create a repo in bitbucket cloud with:  

curl --request GET \\  
--url '[https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}](https://api.bitbucket.org/2.0/repositories/%7Bworkspace%7D/%7Brepo_slug%7D)' \\  
--header 'Authorization: Bearer \<access_token\>' \\  
--header 'Accept: application/json'

The problem is with the "access_token".  
I tried to put there my app password, ssh key, login password, but I always get back the same error:  
{"type": "error", "error": {"message": "Access token expired."}}  

I created a OAuth 2.0 key and secret, but can't extract a access token from them:  

curl -X POST -u "key:secret" \\  
<https://bitbucket.org/site/oauth2/access_token> \\  
-d grant_type=authorization_code -d code={code}

returns   
error: "Cannot use client_credentials with a consumer marked as \\"public\\". Calls for auto generated consumers should use urn:bitbucket:oauth2:jwt instead.", "error": "invalid_grant"}  


Answers:
author: Patrik S
body: Hello Zalman,  

Welcome to Atlassian Community!  
I understand you're trying to create a repository using Bitbucket API, so I would like to highlight a few points on why you are getting these errors :

* HTTP Method : From the request you shared with us you're using the GET method, which is used return an object describing a given repository. In order to create a new repository you should use the POST method instead.
* Authentication Method: I've noticed you're trying to use OAuth2 flow to authenticate your request, and this is usually used to integrate with other applications. In your case I would suggest using the Basic Authentication flow, providing your username and App Password.

That being said, in order to create a new repository using Basic Authentication your cUrl command would look like the following :

```
curl -u "<Bitbucket Username>:<AppPasswords>" -X POST -H "Content-Type: application/json" -d '{"scm": "git","is_private": true,"project": {"key": "<your project key>"}}' https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>
```

If the project is not provided, the repository is automatically assigned to the oldest project in the workspace.  
Please note that App Passwords are different from account passwords. If you haven't created an AppPasswords yet, you can do so following [these steps](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/)  
Also, you can reference to the following documents for more details about the API call and authentication methods :

* [Bitbucket API - Create a repository](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-post)
* [Bitbucket API - Authentication Methods](https://developer.atlassian.com/cloud/bitbucket/rest/intro/#authentication)

Hope that helps to address your questions, let me know if this works for you!  

Thanks, Zalman!  
Kinds regards,  
Patrik S


Tags: bitbucket-cloud

cloud
Slack Notification on PR create
Asked by grandewojtek:

Hi guys,  
I have more than one team working in one repo and would like to set up slack notification on the channel of each team if PR is created. For that I have tried to use glob pattern but with no success. Let's say my team on Jira is called ABC so allowed branch names are:  
\`feature/ABC-123/some-feature\`  
\`bugfix/ABC-123/some-bugfix\`  
\`hotfix/ABC-123/some-hotfix\`  
I have tried to use various patterns but when PR from one of mentioned branchech was created no notification was sent.  
I have tried:  
'\*ABC\*\`  
\`\*\*ABC\*\*\`  
Is there any way to set a notification trigger for all branches with ABC in the name?


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

Thank you for reaching out to Atlassian Community!

I've reviewed your situation, and I understand that branch patterns have been set up for Slack notifications, however, you're not receiving notifications for pull requests creation with the pattern '\*ABC\*'

I have tested the steps in one of my own repositories and observed the same behavior, I am not receiving notifications when creating a pull request on the branch with the pattern (\*ABC\*). However, if I add the pattern "\*/ABC\*" it works for me.

But before you change this, I would like to give you some context around these notifications. In order to receive a notification when creating a Pull Request, you will need to create a pull request with the branch with the pattern as the **target branch**.

**For example:**

Let's say we create a pull request in which the source branch is *feature* and the target branch is *feature/ABC-123*. This will trigger a Slack notification.

* **Source branch** feature -\> **target branch** feature/ABC-123

  * Notification sent indicating a PR has been created

If I use the opposite pull request, in which we have the source branch as *feature/ABC-123* and the target branch as *feature*, this will not trigger a Slack notification.

* **Source branch** feature/ABC-123 -\> **target branch** feature

  * No notification sent indicating a PR has been created

Let me explain why notifications are sent when the branch with patterns is set as the target branch. In a typical workflow, collaborators want to know what changes will affect a target branch. A pull request has changes from a source branch that will be merged with a target branch, so the team wants a notification when changes are coming to the target branch.

I hope this helps, but do let me know if you have any questions.

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud

slack
How can I block users from a repository preventing all access even read/clone?
Asked by Ian Lavers:

I have a requirement to control access to each repository and that includes removing default read/clone access from the repository. Can this be achieved with BitBucket? All our tests so far have resulted in all users being able to clone.


Answers:
author: Christian Glockner
body: Hi Ian,

Repos which are not marked as public and on which no user has been granted access should not be accessible to any user other than the system admin and any users who were granted repository or project administrator permission.

Cheers,

Christian

Premier Support Engineer

Atlassian


Tags: bitbucket-server

server
Request for garbage collection
Asked by Mikina:

Hello!

We are having issues with garbage collection on one of our repositories, from the Outside the Fox workspace. The Repo is for the project Silicomrades.

We have enabled the Garbage collection feature in the labs, but even after we deleted the commit that brought the repository over the limit (last friday, so even if there's a delay, that shouldn't be an issue), the garbage collection still did not happen, and we are still unable to push.

Can I please request a manual garbage collection, if that fixes the issue?

Thank you!


Answers:
author: Caroline R
body: Hi, [@Mikina](/t5/user/viewprofilepage/user-id/2863850)! Thank you for reaching out to Atlassian Community!

I ran the GC against your repository and managed to reduce its size, could you please confirm if everything is working as expected now?

We already 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).

Please feel free to let me know if you need anything further.

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud

garbage-collection
Not receiving Password reset email
Asked by Emrah Ar:

The Password reset is not sending out the one specific address for our domain.

Email address: \<email removed due to privacy reasons\>

Other email addresses on this domain are receiving password reset email without any problem.


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

I checked our logs and confirmed that your email had a block on the server that prevented emails from being sent to you. So I removed your email from this suppression list.

Could you please confirm if you receive the email now?

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud
Are pipeline builds still limited to two hours? Even when running on self.hosted runner?
Asked by Lee Burns:

We want to use the pipeline for hardware simulation regressions, but the two hour limit does not gives us enough time. Other than parallelization, is there a workaround for the two hour time limit?

Thanks.


Answers:
author: Sandesh Shetty
body: [@Lee Burns](/t5/user/viewprofilepage/user-id/4223456)

Similar to Cloud, there is a maximum build time of **120 minutes per step**in self hosted runner.

It seems parallelization is the way to achieve this. Please find the doc. for the same <https://support.atlassian.com/bitbucket-cloud/docs/runners/>


Tags: bitbucket-pipelines
What is the equivalent of --author in Bitbucket REST API?
Asked by Ehab Arman:

Hello,

I am trying to commit changes on behalf of another person using REST API

Is there an equivalent to **git --author** \<name \<email\>\>in rest endpoints?  

The API version used is 1.0

Could someone help?


Answers:
author: Mikael Sandberg
body: Hi [@Ehab Arman](/t5/user/viewprofilepage/user-id/4643229)

Welcome to Atlassian Community!

Bitbucket does not have endpoints for git commands, all your git commands are run locally on your machine and then synced to the remote repository.

comments: author: Ehab Arman
body: Thanks Mikael


author: dbarn
body: That's not technically true, the Bitbucket REST API does have endpoints for uploading and updating files in a repository, which includes the ability to specify a commit message, so these endpoints are clearly running git commands under the hood in order to perform commits. It seems like it should be technically possible to support an additional param to these endpoints for specifying the git author.


Tags: bitbucket-server

rest

rest-api

server
Provision/Deprovision users, groups and group membership
Asked by Karen Stepanyan:

HI

How can I Provision/Deprovision users via Rest Api. As I understand Atlassian user provisioning REST API doesn't work with Bitbucket, are there any alternative solutions?


Answers:
author: duhast
body: Same question here... How can I add/remove users via Bitbucket API ?


Tags: bitbucket-cloud

cloud
I'm not receiving verification emails from Atlassian
Asked by Nicolas Steck Salgado:

Hi,

I've tried to set up a new account for Jira for my work and apparently have had the verification email sent, the email address is correct however I'm not receiving any verification emails

I've tried re-sending the email a number of times and haven't received any of them.

Kind regards,

Nicolas.


Answers:
author: Paintball Beasts
body: Hi Nicolas, I was facing a similar problem. There are two possible fixes, If you created account from you Google or Microsoft email than you can [connect](https://paintballbeasts.com/) them directly. Secondly, check your spam folder, I found many of my mails there.


Tags: bitbucket-cloud

cloud

email

jira
Public Project, Private Repo Access
Asked by NetTech:

Hi,

Is there anyway someone could gain access to a private repo if it was contained within a public project?

Thanks.


Answers:
author: Sandesh Shetty
body: [@NetTech](/t5/user/viewprofilepage/user-id/4642008)

Even if the project is public, no one will get access to private repository until and unless you added users explicitly to the private repository!!

comments: author: Lewis Barbour
body: If a workspace is private and contains a public repo, can anyone gain access to the repo? Or does the private setting from the workspace prevent access to the public repo?


Tags: bitbucket-cloud

cloud
Anyone else getting double-billed for Bitbucket Pipelines?
Asked by shazaman23:

I've been reviewing regular bills trying to find ways that I can cut back lately. To my surprise, I found that Atlassian has been charging my credit card on 2 different days for the same invoice every month for the last year.

Anyone else had the same experience or know how to get someone from billing to engage on a support ticket to resolve the issue?

Planning to just switch to CircleCI instead. I can do the same thing with better integrations for free there.


Answers:
author: Caroline R
body: Hi, [@shazaman23](/t5/user/viewprofilepage/user-id/4006898),

I saw that you created a ticket with our team related to the same question, so to avoid any possible misunderstandings or miscommunication that may arise from discussing the same matter on two different platforms, let's focus on the ticket instead.

Besides that, in case someone else has the same problem, you can open a support ticket with us via <https://support.atlassian.com/contact/#/>, and in "What can we help you with?" select "Billing, payments, and pricing".

Kind regards,  
Caroline


Tags: bitbucket-cloud

bitbucket-pipelines
Deploying Flask Application to AWS with Beanstalk
Asked by Eoghan Dinan:

![Screenshot 2021-11-18 at 19.37.04.png](https://community.atlassian.com/t5/image/serverpage/image-id/170069i67EEEAC660F7DCF6/image-dimensions/610x381?v=v2 "Screenshot 2021-11-18 at 19.37.04.png")

Having trouble deploying a Flask application via Github pipeline

Anyone got any ideas?


Answers:
author: Oleksandr Kyrdan
body: Hi [@Eoghan Dinan](/t5/user/viewprofilepage/user-id/4641613)

Thank you for your question!

It's a good case to use pipe in the Bitbucket Pipelines, [examples provided in the community answer](https://community.atlassian.com/t5/Bitbucket-questions/Deploy-to-AWS-with-Elastic-Beanstalk/qaq-p/1802364#M71925).

Also, please, follow our good [Deploy to AWS with Elastic Beanstalk guide](https://support.atlassian.com/bitbucket-cloud/docs/deploy-to-aws-with-elastic-beanstalk/).

Best regards,  
Oleksandr Kyrdan


Tags: bitbucket-pipelines
Bitbucked does not deliver invitation email to @mail.ru
Asked by Maxim Makarenko:

Hello!  

I am trying to add a new user with email andrey_........v@mail.ru (some characters are masked because of privacy). Unfortunately the user never got the invitation and I can't add him to my team.  

I found a similar question here: <https://community.atlassian.com/t5/Bitbucket-questions/I-m-not-receiving-verification-emails-from-Atlassian/qaq-p/1843330>  

Can you please look at my issue too and fix it?   

Best Regards,  
Maxim


Answers:
author: Daniel Eads
body: Hi [@Maxim Makarenko](/t5/user/viewprofilepage/user-id/946230) ,

Thanks for including that much of the email address - I was able to find it in our mail logs and determine that Atlassian's mail service has temporarily stopped sending mail to that address. The mail server returned this error to us:
> 550: 550 Message was not accepted -- invalid mailbox. Local mailbox ...@... is unavailable: user not found

I have cleared the error out - additional invitations will be sent (you need to re-send it in Bitbucket) and *should* be delivered, if the mailbox exists on the server now.

Cheers,  
Daniel \| Atlassian Support

comments: author: Maxim Makarenko
body: Hello Daniel,  

Thank you very much! It looks like a glitch, because this time it worked with the same email.  

Regards,  
Maxim


Tags: bitbucket-cloud

cloud
Get project or repository access log
Asked by Antoni Bertran:

He we know how to get auditlog for global workspace

using

<https://bitbucket.org/>\<workspace-slug\>/workspace/settings/auditlog

From

<https://community.atlassian.com/t5/Bitbucket-questions/Where-can-I-find-the-place-to-view-audit-log/qaq-p/1487033>

But I want to get the access logs of a project or repository, is it possible?

thanks


Answers:
author: Syahrul
body: Hi [@Antoni Bertran](/t5/user/viewprofilepage/user-id/1504741)

Unfortunately, there's no audit log for project or repositories level available in Bitbucket at this moment. We do have an existing feature request on this, please **Vote \&** **Watch** the feature request so that you'll receive an update whenever we have any at:

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

Additionally, we do have a roadmap planned to update our audit log and add more information to it around FY22, more information please check our roadmap at:

* [Bitbucket Cloud Roadmap](https://www.atlassian.com/roadmap/cloud?selectedProduct=bitbucket)

I hope this helps.

Cheers,  
Syahrul


Tags: bitbucket-cloud

cloud

log
Email address
Asked by Andrew Ziem:

**Basically: part of my email address is being replaced.**

When I make any Git commits in Sourcetree for Windows 1.4.1.0 , my email address shows up in the commit as like andrew@**hostname** .example.com (where **hostname** is the actual hostname of my laptop) instead of andrew@**us**.example.com (my corporate email address with a subdomain).

I set my email address in Sourcetree under Tools - Options. I allow Sourcetree to modify Git global configuration, and my .gitconfig looks correct in $USERPROFILE/.gitconfig

I use the embedded Git


Answers:
author: Andrew Ziem
body: Changing my email address to something else and back solved the problem


Tags: email
Sourcetree git cloning warning: templates not found
Asked by st:

Using embedded-git v1.8.4.2 in sourcetree, when i clone repository i receive this warning:

warning: templates not found /usr/local/git/share/git-core/templates

Welcome your advice...something related to PATH settings?


Answers:
author: Gordon Kam
body: I have the same problem when cloning the Git repo from bitbucket. I just let it continue running for 5-10 minutes, it will clone the repo eventually. This is what I get afterwards.

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree submodule update --init --recursive

Completed successfully


author: st
body: Thanks for replying. Tried but waiting didn't resolve. Closed Sourcetree and just used git in terminal and cloning works perfectly. So there must be something with Sourcetree. Will stick to using git in terminal.


author: Manju
body: You can try using system git if SourceTree is using embedded git in Preference window -\> Git and see if it works.

comments: author: anicapil
body: Thanks a lot MBS. Your comments helped me as clone wasn't working for me using both source tree and bash. But changing embedded to system helped me.


author: Azadeh
body: Same here, was experiencing same issue and works perfectly now. Thanks!


author: Chris Bennell
body: I had the same problem, I saw that it had created the folder and the hidden git subfolder but nothing else. I cancelled and chose the "checkout existing" tab and selected the folder it had just created, then clicked checkout and it pulled the source down right away.

comments: author: Shakhawat Amin
body: Hello [@Chris Bennell](/t5/user/viewprofilepage/user-id/557299),  
I did not yet your answer. Can you explain a bit. How to choose "checkout existing"?


author: aareeph
body: Try downloading repository with GitHub Desktop application.

<https://desktop.github.com/>
Move lines from hunk to new patch (hg)
Asked by ratcliffe_mike:

I am using SourceTree to try to break a large patch into smaller patches so that they are easier to review.

Hunks may contain content that should be split into other patches so ideally I would be able to highlight a few lines from a hunk and somehow mark them for moving into a new patch.

Is there any way to move lines from one patch into a new / other patch?

This is for a Mercurial repository on OSX.


Answers:
author: ratcliffe_mike
body: Seems like this is not possible in SourceTree but there is a Mercurial extension that allows per hunk and per line cherry picking. At first I was put off by the fact that it has a text only interface but when I tried it I was surprised by the fact that it was so pleasant to use.

crecord is available from [](http://bitbucket.org/edgimar/crecord/get/tip.zip)<http://bitbucket.org/edgimar/crecord/get/tip.zip>... unzip it somewhere, chmod +x \* in that folder and add it to your extensions section:

```
[extensions]crecord = path/to/crecord/
```

To use it:

```
$ hg qref -X .     # take changes out of current patch and back into `hg diff`$ hg qcrecord -m "Did something!" new-patch-name.patch
```

The text interface is easy to use, navigate using the cursor keys and select things using space.

It would certainly be nice to be able to do this inside SourceTree though.
What do bookmark icons mean?
Asked by K P:

What do the following icons in the bookmark panel mean?

![](../../upfiles/SourceTreeIcon_2.jpg)

Is there documentation for the definitive list of icons?


Answers:
author: Seth
body: The icons to the left of the branch name represent the differences between your working copy and the local branch your working copy is checked out from.

A green checkmark means there are no differences. The two icons above refer to "files changed" (90) and "unstaged new files" (1). There is also a green icon for staged new files, grey or red minus icon for deleted icons (staged or unstaged), a yellow exclamation for conflicts, and a yellow arrow for renamed files. There may be some other less common potential differences that I've never seen as well.

There are also green arrows that can show up to the right of the branch name the represent how many commits are waiting to be pushed (up) and/or pulled (down) from remotes.

EDIT: The branch icon means that the name next to it is a branch. If it has a check, that's the branch that is checked out.

comments: author: Seth
body: These icons are the same as what shows up in the changes panels. I don't know of any documentation about them, they just seemed intuitive to me.


author: K P
body: Thanks Seth! It is initituitive now for me.


author: TheRealRaphi
body: I still wish there was a glossary of icons, as searching for these types of Questions/Answers to find a particular icon is cumbersome


author: Frank_Spafford
body: I agree with Raphi Stein.


author: Volodymyr Dhzychko
body: To have infographics - would help a lot!


author: Tim Anderson
body: Agree infographic page would help as it is unclear to those just starting to use Jira.
Copy file paths to clipboard
Asked by Ricardo Lowe:

When using SourceTree 1.4.1.0, how do I copy the relative or absolute file paths for either highlighted files or for an entire commit?

I would like to copy and paste all the committed files to a file compare session to expedite deployment of code.

-Ricardo


Answers:
author: Timothy
body: Have you tried to create custom action ([](http://blog.sourcetreeapp.com/2012/02/08/custom-actions-more-power-to-you/)<http://blog.sourcetreeapp.com/2012/02/08/custom-actions-more-power-to-you/>)? Not sure of what is the script you need but that could be a start for you.
browsing changes by file
Asked by Andrew Ziem:

In Sourcetree 1.4.1.0 for Windows I would like to browse the list of files. Then, I would like to browse the changes for each file.

This is easy to do in the web interface, but I don't see it in Sourcetree, which shows a log of the latest commits.


Answers:
author: Seth
body: You can see historical changes for a file by right clicking the file and choosing "Log Selected...".

You can see all files (but not in a tree view, as Andrew pointed out), by changing the filter from "Show Pending" to "Show All".


author: Andrew Ziem
body: duplicate of <https://answers.atlassian.com/questions/179045/is-there-a-explorer-finder-file-view-in-sourcetree>
Log messages are shown as a mess
Asked by Guo Li:

Hi, there is a problem bothering me for a long time, just like the picture shown below, my log messages(in Chinese) are shown as a mess in the upper window, but in the bottom window every log message is shown correctly. Most of these commits are made through SourceTree 1.8.1, the others are done in a terminal with UTF-8 encoding. What's wong? Thanks ahead!

![](../../upfiles/_Users_glfruit_Projects_Personal_mousika__Git_.png)


Answers:
author: Seth
body: Looks like a bug to me. You'll get better response from the developers at [support.atlassian.com](http://support.atlassian.com)