youngmon/atlassian-qna huggingface dataset:
Does Bitbucket provides java API for importing a repository ?
Asked by NITIN ALETY:

url : <https://support.atlassian.com/bitbucket-cloud/docs/import-a-repository/>

1. Select **Create \>** select **Repository**from the dropdown menu.

2. Click **Import repository** from the **Create a new repository** page.

3. Select the **Source** of the code you want to import.

4. Depending on the **Source**, the system asks you to provide the following information:

   * **CodePlex**: URL, Project name, Repository type

   * **SourceForge**: URL, Project name, Repository type

   * **Git**: URL, Username/Password combination for private repositories that Require authorization

     * **Note:**If your organization has configured a personal access token to retrieve the repository via your Git client or the command line, then you may need to use it in lieu of your username/password within the Bitbucket importer.

5. Enter a **Name** for your new repository.

6. Uncheck **This is a private repository** if you want the repository to be public.

7. Select the **Repository type**.

8. Expand **Advanced settings** and fill out the rest of the page if necessary.

9. Press **Import repository**.

Does Bitbucket provides java API for creating and importing repository ?


Answers:
author: Theodora Boudale
body: Hi [@NITIN ALETY](/t5/user/viewprofilepage/user-id/5040496),

Bitbucket Cloud doesn't have an API for importing a repository, but we do have a REST API for creating a repo:

* <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-post>

After creating an empty repo, you can take a mirror clone of the repo from the other hosting provider and then push the mirror clone to the newly created Bitbucket repo.

If you want to migrate from Bitbucket Server to Bitbucket Cloud, we have a plugin to migrate repos:

* [https://marketplace.atlassian.com/apps/1226610/bitbucket-cloud-migration-assistant?tab=overview\&hosting=server](https://marketplace.atlassian.com/apps/1226610/bitbucket-cloud-migration-assistant?tab=overview&hosting=server)

Kind regards,  
Theodora


Tags: bitbucket-cloud

bitbucket-server

server
How can I manipulate a branch that is not the triggering branch in a pipeline?
Asked by Christof Koegler _Gaims GmbH_:

I have the following scenario:

Whenever file A changes in branch 'develop', I want to copy these changes to branch 'main'.

I added a step to my pipeline which triggers whenever file A changes in branch 'develop', but apparently Bitbucket only clones the triggering branch, so 'main' is not available in the pipeline.

I have tried to fetch, pull, checkout -b, etc. but to no avail. I also tried re-cloning the whole repository, but have run into permission issues.

How can I go about this?


Answers:
author: Syahrul
body: Hey [@Christof Koegler _Gaims GmbH_](/t5/user/viewprofilepage/user-id/5011301)

Welcome to the community.

I believe you are missing the 'main' branch because, by default, the Bitbucket pipeline only does a shallow clone of your repository, which only includes the triggered branch.

To fix this, simply add full clone depth in your YAML which should trigger the full clone as mentioned in our guide [here.](https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/#depth--Git-only-)

```
clone:
depth: full # include full clone
pipelines:
default:
- step:
name: Cloning
script:
- echo "Clone all the things!"
```

Cheers,  
Syahrul

comments: author: Christof Koegler _Gaims GmbH_
body: Thanks, [@Syahrul](/t5/user/viewprofilepage/user-id/744536)!

Cheers,  
Chris


Tags: bitbucket-cloud

cloud
Can we grant access to a service account for a bitbucket repository?
Asked by Dinesh Marella:

I have a request to add a service account to access bitbucket repository. How can i do that?


Answers:
author: Caroline R
body: Hi, [@Dinesh Marella](/t5/user/viewprofilepage/user-id/5040423), welcome to the community!

Currently, Bitbucket Cloud does not have service accounts, but we have the following feature request to have this functionality implemented:

* [Ability to use Service account on Bitbucket Cloud](https://jira.atlassian.com/browse/BCLOUD-15600)

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

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

Implementation of new features is done as per our policy [here](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html) and any updates will be posted in the feature request.

As for now, we advised you to use a regular account with an email address as a "service account" to work around the current lack of this offering.

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

Kind regards,  
Caroline

comments: author: Dinesh Marella
body: Thanks Caroline, Just wanted to confirm if we can grant readonly access to the service accounts for the repositories in bitbucket?


author: Caroline R
body: Hi, [@Dinesh Marella](/t5/user/viewprofilepage/user-id/5040423),

If what you need is just to grant read-only access to this account, I would recommend you add an **Access key** to your repository to allow this user or service to authenticate when pulling or cloning a repository over SSH.

An access key has the following features and limitations:

* Grant read-only access to a public or private repository.

* Don't require additional users on your plan.

* Can be added to multiple repositories.

* Can't also be associated with an account.

* Don't require a passphrase when used for automated processes.

In case you would like to add an Access key, you can access the next document to check all the steps to achieve this:

* [https://support.atlassian.com/bitbucket-cloud/docs/add-access-keys](https://support.atlassian.com/bitbucket-cloud/docs/add-access-keys/)

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

Kind regards,  
Caroline


Tags: bitbucket-cloud

cloud
How to "Enable Pipelines"
Asked by Alexei.Yugov:

Hello! I want to switch on the "Enable Pipelines" trigger at "Repository Settings"/"Settings". But the site says to me:

"Forbidden  

Two-step verification must be set up for this user in their Bitbucket settings to enable pipelines in this workspace.

"

I've enabled two-step authorization at "manage account"/"Security". And I made a logout/login iteration, and the site asked me to enter the code from Google Authenticator from my phone, and I entered the code, and I logged in to <https://bitbucket.org/>.   

But it is still forbidden for me to enable pipelines. What is wrong?


Answers:
author: Caroline R
body: Hi, [@Alexei.Yugov](/t5/user/viewprofilepage/user-id/5040403), welcome to the community!

Checking your account, I see that you have enabled the MFA for your Atlassian account, however, the 2sv for Bitbucket Cloud is a different thing, and this one is currently disabled on your account.

In order to [enable the 2sv for your BB account](https://support.atlassian.com/bitbucket-cloud/docs/enable-two-step-verification/), you can follow the next steps:

1. From your avatar in the upper right corner, click [**Personal settings**](https://bitbucket.org/account/settings/).

2. Click **Two-step verification** under **Security**.

3. Review the requirements and make sure you've fulfilled them all.

4. Enter your Atlassian Account password and click **Set up two-step verification** .  
   If your Atlassian account does not have a password, you'll need to set one in order to set up two-step verification. You can set a password for your Atlassian account using [password recovery](https://id.atlassian.com/login/resetpassword). Once you've set a password, log in to Bitbucket again and proceed.

5. Scan the QR code using your mobile devices and enter the resulting code in the **Verification code** field.   
   If your mobile device cannot successfully scan the code, you can use the information in the **Account** and **Key** fields to connect your application. See the instructions for your authentication application to complete the process.

6. Download or otherwise record your recovery codes and keep them in a secure place where you can access them.

Also, it's not necessary to have both MFA and 2sv enabled, so as you need to enable the 2sv (Bitbucket Cloud), you can disable your MFA (Atlassian) by accessing your [Atlassian profile](https://id.atlassian.com/manage-profile/security).

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

Kind regards,  
Caroline


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Copy an artifact to a directory in repository
Asked by Krishna Kumar Singhal:

I need to copy the allure results after test execution to a folder in the main repository so I can use it to publish results.

Using this command:  
cp -r allure-report $BITBUCKET_GIT_HTTP_ORIGIN/public

Getting this error:  
+ cp -r allure-report $BITBUCKET_GIT_HTTP_ORIGIN/public  
cp: cannot create directory [/bitbucket.org/63idealabs/nc-test-automation/public](http://bitbucket.org/63idealabs/nc-test-automation/public): No such file or directory


Answers:
author: Mark C
body: Hi [@Krishna Kumar Singhal](/t5/user/viewprofilepage/user-id/5037676)

Thank you for reaching out to the community.

From your configuration, instead of using the variable **$BITBUCKET_GIT_HTTP_ORIGIN** , would it be possible for you to try to use **$BITBUCKET_CLONE_DIR** since you're referring to a directory?

Let me know how it goes.

Regards,  
Mark C

comments: author: Krishna Kumar Singhal
body: Thanks for your reply [@Mark C](/t5/user/viewprofilepage/user-id/1210823), this issue was resolved, didn't delete just in case someone else had the same query.


Tags: artefact

bitbucket-cloud

cloud
Atlassian single sign-on doesn't work
Asked by Ji Feng:

Hi,

I was able to log into Atlassian account, but failed to access my bitbucket account. Here is what I got when the login redirects to bitbucket. I am using Chrome and it doesn't have any extension installed. Could someone help? Thanks!

![bitbucket_login.png](/t5/image/serverpage/image-id/217818iBE04AB4AA60A1609/image-size/large?v=v2&px=999 "bitbucket_login.png")


Answers:
author: Caroline R
body: Hi, [@Ji Feng](/t5/user/viewprofilepage/user-id/5040077), welcome to the community!

I confirmed that your Bitbucket account was set as inactive because you haven't logged in for a long time, so I reactivated it. Could you please try to access it now and let me know how it goes?

Looking forward to hearing from you.

Kind regards,  
Caroline

comments: author: Ji Feng
body: Hi Caroline,

I can access the bitbucket now. Thanks for fixing it.

Best,

Ji


author: Caroline R
body: Thanks for your confirmation, [@Ji Feng](/t5/user/viewprofilepage/user-id/5040077)! I'm glad to help!

Kind regards,  
Caroline


author: Ollie Guan
body: Hi [@Ji Feng](/t5/user/viewprofilepage/user-id/5040077) ,

Can you log into the Atlassian portal with your account?

<https://id.atlassian.com>

comments: author: Ji Feng
body: Yes, I can. I was posting the question with an authenticated session and I am still logged in with Atlassian. Thanks!


Tags: bitbucket-cloud

cloud
SSH Key on Repo
Asked by bmdinteractive:

Git is telling me that "Someone has already added that key as an access key to a repository.", but I'm the only one who owns the repository.

I have two bitbucket accounts, and neither of them have this key attached.

Wondering if this is related to some weirdness that happened a long time ago when I changed email/merged accounts a long time ago.


Answers:
author: Caroline R
body: Hi, [@bmdinteractive](/t5/user/viewprofilepage/user-id/772901), thank you for reaching out 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
copy bitbucket user permissions to another user
Asked by stephen_kashu:

How do I copy the repo permissions a user has to another user in bitbucket?


Answers:
author: Syahrul
body: Hey [@stephen_kashu](/t5/user/viewprofilepage/user-id/4996015)

Welcome to the community!

Currently, it's not possible the copy repository permission from one user to another.

However, suppose you manage the user at the group level. In that case, you can add the new user to the groups, which should automatically apply the same permission the other user has in the Groups to the new user.

Please check our guide on how to use the user groups feature with the repository at:

* [Manage user groups in the repository](https://support.atlassian.com/bitbucket-cloud/docs/grant-repository-access-to-users-and-groups/#Update-user-or-group-access-for-a-repository)

Cheers,  
Syahrul

comments: author: stephen_kashu
body: thank you Syahrul


Tags: bitbucket-cloud

cloud
Pipeline variables
Asked by Nastya Sekerich:

Hi!   
I have a question about the default variables.   
Are there exist any variables to show that it is a merge action?  
For example something like CI_PIPELINE_SOURCE in GitLab  

Cause I need to run a step only once when we create PR, and it should doesn't run when we update this PR later.   

I cannot find something similar in the documentation.   
Thanks a lot!


Answers:
author: Theodora Boudale
body: Hi [@Nastya Sekerich](/t5/user/viewprofilepage/user-id/5039674) and welcome to the community!

I would like to ask for some clarification about your use case.

You mentioned:
> Cause I need to run a step only once when we create PR, and it should doesn't run when we update this PR later.

Can you please clarify what action you are referring to by "updating the PR later"?

At first, I thought that by "updating the PR" you meant pushing new commits to the source branch. However, earlier in your post you make a reference to a "merge action", so now I am unsure if by "updating the PR" you mean merging it, pushing commits to the source branch, or something else.

Can you please clarify, so I can better answer your question?

Kind regards,  
Theodora

comments: author: Nastya Sekerich
body: Thanks a lot, [@Theodora Boudale](/t5/user/viewprofilepage/user-id/818086)! Glad to join you!  
Yes, I mean the first describing situation. When we already open Pull Request and then we push some commits to this branch. So this pull request will be "updated" with these added comments.  
Can we somehow keep track of open action and avoid running the pipeline step during the update?


author: Theodora Boudale
body: Hi [@Nastya Sekerich](/t5/user/viewprofilepage/user-id/5039674),

Thank you for the clarification!

I'm afraid that this is not possible at the moment. We have [pull request pipelines](https://support.atlassian.com/bitbucket-cloud/docs/configure-bitbucket-pipelinesyml/#pull-requests) that get triggered both when a PR is created, but also when the source branch gets updated with new commits. It is not possible to run them on PR creation only and we don't have a variable that will show if the trigger was PR creation or update.

I can create a feature request for what you're asking for our development team to consider, please feel free to let me know if you'd like me to proceed with that.

Kind regards,  
Theodora


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
Git View from within Sourcetree
Asked by siggib007:

Sometimes I need to see what a particular source file actually looked like x changes ago. Looking at the log doesn't give me the picture I need, I want to actually see the file itself without changing the current file. I can do this with "git show" command from the command line as in git show SHA:Filename, however I'd love to be able to do this within SourceTree. Sourcetree doesn't seem to offer this natively and I can't seem to get custom actions to work with this. Anyone have any suggestions?


Answers:
author: bgannin
body: Like so?

![Screen Shot 2017-10-19 at 6.45.12 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/8011iE463D2E36BE3BA2A/image-dimensions/444x301?v=v2 "Screen Shot 2017-10-19 at 6.45.12 PM.png")

![Screen Shot 2017-10-19 at 6.46.15 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/8012iA7813F5E540B98A7/image-dimensions/347x235?v=v2 "Screen Shot 2017-10-19 at 6.46.15 PM.png")![Screen Shot 2017-10-19 at 6.46.38 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/8013iBC254DF7D7809335/image-dimensions/460x398?v=v2 "Screen Shot 2017-10-19 at 6.46.38 PM.png")

comments: author: siggib007
body: I did that but I don't have anything in my custom actions

![2017-10-19_21-13-37.png](https://community.atlassian.com/t5/image/serverpage/image-id/8017iCBB2360A5DC5E6C7/image-size/large?v=v2&px=999 "2017-10-19_21-13-37.png")![2017-10-19_21-14-42.png](https://community.atlassian.com/t5/image/serverpage/image-id/8016i0EB3D04C00E624FD/image-size/large?v=v2&px=999 "2017-10-19_21-14-42.png")


author: siggib007
body: BTW based on the syntax need to run those from a command line without having to worry about path variables or what directory you are the parameter should be "-C $REPO show $SHA:$FILE" so this should work

![2017-10-19_21-23-14.png](https://community.atlassian.com/t5/image/serverpage/image-id/8018i7BDABD230B1D3436/image-size/large?v=v2&px=999 "2017-10-19_21-23-14.png")However the custom actions menu has no submenu.
SourceTree atlassian authentication issue during installation
Asked by Mehrad Tavakoli:

Hi,

We are trying to install SourceTree using the latest installer on Windows 10 devices. During the step that we need to log in to our Atlassian account, when we click on the "Use and existing account", the window that opens up (which is an HTML page), does not show up. I figured since we are installing on Windows 10, the app is trying to open the HTML page with Microsoft Edge, and seems like the latest page for authentication does not work on IE. In fact, when I click on "Got to my atlassian", if I open the link with Microsoft Edge, it does not open either, and the same link works on Chrome. Note that our default browser in the system is set to Chrome, but the installer only chooses the OS builtin browser and hence this issue, This is stopping us from being able to install SourceTree.


Answers:
author: Mikael Sandberg
body: First off, welcome to the Atlassian Community!

Have a look at this thread and see if it helps resolve it, <https://community.atlassian.com/t5/Sourcetree-questions/Sourcetree-won-t-install-on-windows-7/qaq-p/652314>


Tags: windows
Cannot sig in while installing source tree on windows
Asked by pbimalkhedkar:

I am trying to install source tree on my desktop. When I go to the Atlassian account tab, I select use existing account.

When I enter my credentials, it just keeps processing and does nothing.


Answers:
author: Ana Retamal
body: Hi Priyanka, are you getting a blank screen? If so, that issue has already been reported in our bug tracker at [SRCTREEWIN-7244](https://jira.atlassian.com/browse/SRCTREEWIN-7244). There are a few workarounds listed in the comments, there's one specially that seems to be working for most of the users so I'll copy it here for you:
> From a working install collect the accounts.json and passwd files.
>
> Delete the Atlassian folder from the AppData/Local directory for your user. Run the installer for 2.3.1, close it when you get the blank login window. Place the account.json and passwd files into the Atlassian/SourceTree folder. Rerun the installer. It should detect the account and password from those files and bypass the request for a login.

Some users shared other tips too, so you might want to check this [Community thread](https://community.atlassian.com/t5/Sourcetree-questions/Installation-Blank-window-appear-for-quot-use-existing-account/qaq-p/645154?utm_source=atlcomm&utm_medium=email&utm_campaign=immediate_general_reply&utm_content=topic#U651319). Let us know if it worked for you!

If it's something different, please clarify what specific issue are you getting and send us a screenshot so we can continue helping you.

Best regards,

Ana

comments: author: pbimalkhedkar
body: Hello Ana,

I will this out however I am not getting a blank screen. I am on the login screen and i enter my credentials click submit and i get a processing icon which runs in a loop and then nothing. It just keeps running.
Where is the Sourcetree license?
Asked by Leonel:

I have searched for quite a while now and I can't find the Sourcetree license? I need it because the company I work for requires to review the software license before approving its use.

Shouldn't something as basic as the software license be easily accessible for Sourcetree users?

Is there a link that points to the Sourcetree software license?

I have seen the outdated replies. We need current information.

Thanks,

Leonel


Answers:
author: Nic Brough -Adaptavist-
body: By "licence", do you mean "terms of use"? If so, then Sourcetree is covered by the standard pile of Atlassian blurb, starting at <https://www.atlassian.com/legal/customer-agreement>
Source tree is installed and Atlassian account is set up but not able to apply the SSH key
Asked by ramesh_deokar:

Source tree is installed in my system. I also set up the Atlassian account but not able to apply the SSH key as there is no provision visible under the Profile tab as suggested in the manual.

Kindly help me.

Thanks in advance.


Answers:
author: Ana Retamal
body: Hi Ramesh, are you trying to add your SSH key to Sourcetree or Bitbucket?

For Sourcetree you can follow the instructions at [Load SSH keys into Sourcetree](https://confluence.atlassian.com/sourcetreekb/generate-and-load-ssh-keys-into-sourcetree-with-putty-790629663.html). For Bitbucket you can follow [Set up an SSH key](https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html#SetupanSSHkey-#installpublickeyStep2.AddthepublickeytoyourBitbucketsettings).

If you're still unable to add the SSH key, please be more specific on which product and where are you getting stuck so we can continue helping you :) It will also be useful if you send us a screenshot.

Cheers,

Ana


Tags: bitbucket