youngmon/atlassian-qna huggingface dataset:
How to define different users for different directory access
Asked by sysuwhb:

How to define different users for different directory access.

In my repos containing a c++ solution, I want to make different users to have different projects which are in different directory.

Such as A, B two users, D1, D2, D3 three directory in my repos.

The A user only could read D1, D2 directory.

The B user only could read D2, D3 directory.


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

Giving access to a certain directory only in a repo is something not supported natively by Git and we don't have such a feature available either. When a user gets granted access to a repository, they have access to the whole repo.

You may want to look into Git submodules instead and see if it's something that would work for you:

* <https://www.atlassian.com/git/tutorials/git-submodule>
* <https://git-scm.com/book/en/v2/Git-Tools-Submodules>

E.g. you could create three separate repos for each directory (D1, D2, D3) and then make these repos submodules to your main repo. This way, you could give access to users only to certain submodule repos.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
What should be given as callback url in bitbucket integration with sonarqube?
Asked by Anshuta Mishra:

What is the importance of callback url in bitbucket. I have set the url of my bitbucket repository (i. e. path of my bitbucket repository) as callback url. is this the reason why I am getting a connection refused error in my bitbucket pipeline. can we set any url as callback url as it's not used by sonarqube so can we set [www.google.com](http://www.google.com) as callback url as well. read somewhere that callback url is only used to redirect page


Answers:
author: Syahrul
body: Hey [@Anshuta Mishra](/t5/user/viewprofilepage/user-id/5070771)

Welcome to the community!

The connection refuses error you received is not related to the callback URL, as the error generally happens if your server is rejecting/refusing our connection.

This can happen if you have a Firewall in between that has IPs whitelisted enabled.

I suggest you whitelist our Webhook IPs to allow our request from the list below:

* [What are the IP addresses to configure a corporate firewall?](https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/)

Cheers,  
Syahrul


Tags: bitbucket-cloud

cloud
Someone has already added that key as an access key to a repository.
Asked by Pradeep Gowda:

I'd like to add my public key to my account.

IFAICT, I don't have this associated with any other account (ie., personal)


Answers:
author: Mark C
body: Hi [@Pradeep Gowda](/t5/user/viewprofilepage/user-id/5070582),

Welcome to the community.

Do you probably recall adding it to a repository?  
I believe it is referring to a repository as [Access key](https://support.atlassian.com/bitbucket-cloud/docs/add-access-keys/).

Regards,  
Mark C


Tags: bitbucket-cloud

cloud
Getting this error while executing test from bitbucket "/opt/atlassian/pipelines/agent/build/resourc
Asked by Nirav Panchal:

I am working on a selenium automation java maven project and I have created one pipeline in bitbucket now I want to run all the automated tests but I am getting the below error.

java.lang.IllegalStateException: The driver executable does not exist: /opt/atlassian/pipelines/agent/build/resources/files/software/WINDOWS/chromedriver.exe  

Can anyone help me out on this?


Answers:
author: Aron Gombas _Midori_
body: Your test is referencing the "chromedriver.exe", but it is not available for the Pipeline The whole thing looks broken to me because Pipelines is running the test in Docker containers (\~ Linux virtual machines), so referencing a Windows executable is not gonna work.

You should write your tests in a platform-independent way, then create a Docker image that contains Chrome Driver and use that in Pipelines.

(We are running Webdriver tests in Pipelines, and Webdriver is using the same foundation, so I can confirm that it is doable.)


Tags: bitbucket-cloud

cloud
There's a way to upload/change only modified files?
Asked by antonio.gonzalez:

I'm using "SFTP Deploy", if I change only one file, I prefer the pipeline just load the files with new changes since the last upload. That's possible?

Thanks!

Regards.


Answers:
author: Aron Gombas _Midori_
body: [sftp](https://manpages.ubuntu.com/manpages/trusty/en/man1/sftp.1.html) itself doesn't support syncing, so I'm afraid you won't be able to do this.

(In contrary, the AWS S3 client can upload changed files only.)


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

sftp
How to get http access token using curl for a user or repository/project??
Asked by Mohammed Muthahhar:

If there is a way to get http access token without creating a consumer, using curl..Please mention it to me..I am a developer...


Answers:
author: Aron Gombas _Midori_
body: I think, if you don't want to go the Oauth way, you should use [app passwords](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/). (But note that these are tied to user accounts.)

comments: author: Mohammed Muthahhar
body: So, how can we use app passwords? can we use it as access tokens?? or is there a way to use those to access the details??


author: Aron Gombas _Midori_
body: See the section "Using App passwords with Bitbucket APIs" on this page:

<https://support.atlassian.com/bitbucket-cloud/docs/using-app-passwords/>

As you can see, the username and the app password together can used as a BASIC auth token (very easy, standard way).


author: Mohammed Muthahhar
body: Thanks [@Aron Gombas _Midori_](/t5/user/viewprofilepage/user-id/502447)


Tags: bitbucket-cloud

cloud
Can't update PR update api
Asked by Nurzat_Zhanabek:

```
![?????? ?????? 2022-11-03 ? 15.48.58.png](https://community.atlassian.com/t5/image/serverpage/image-id/223942iB0B70BFDE3C1E29D/image-size/large?v=v2&px=999 "?????? ?????? 2022-11-03 ? 15.48.58.png")- >
  curl https://api.bitbucket.org/2.0/repositories/${BITBUCKET_REPO_OWNER}/${BITBUCKET_REPO_SLUG}/pullrequests/${BITBUCKET_PR_ID} \
                        -s -f -S -X PUT \
                        -H "Content-Type: application/json" \
                        -H "Authorization: Bearer ${BB_TOKEN}" \
                        -d \
                        '{
                            "reviewers": [
                                {
                                  "uuid": "'"$REVIEWER_UUID"'" here if i write hardcode id "id" its working
                                }
                            ]
                        }'

in this trigger:
```

```
pull-requests:
  '**':
```


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

I believe that the variable will not get expanded when you use single quotes for the data. Please try replacing the data with the following, use double quotes:

```
-d \
"{
    \"reviewers\": [
        {
            \"uuid\": \""$REVIEWER_UUID"\"
        }
    ]
}"
```

I tried this in a Pipelines build in a repo of mine and the reviewer gets successfully added.

Please feel free to let me know how it goes.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
"Something went wrong" when creating commit by uploading the file
Asked by Artur Gordashnikov:

I'm updating the file using the following endpoint

```
/2.0/repositories/{accountName}/{repoName}/src
```

The same exact code works great with 3/4 repositories, but one returns 500 with the following message

```
{"type":"error","error":{"message":"Something went wrong","id":"b269a691d3b14d5e85b3316c934d4ef4"}
```

I can see the file was updated despite the error.


Answers:
author: Syahrul
body: Hey [@Artur Gordashnikov](/t5/user/viewprofilepage/user-id/3615925)

G'day.

The error code you've shared translated to a timeout error which generally happens if the upload files are large or if there's a network issue while uploading the files.

Though the files were updated in UI, they may partially be uploaded in some cases.

That said, I would suggest reviewing the files to verify if it does upload everything for standard code files. If it's binaries files, you may need to clone the repository to test them.

I hope this helps.

Cheers,  
Syahrul

comments: author: Artur Gordashnikov
body: Hey [@Syahrul](/t5/user/viewprofilepage/user-id/744536) thanks for the reply.

The file is a pretty small XML file, only 16KB. It also happens only in this particular repository. Other repositories respond with no errors and I'm uploading this file to 3 repos simultaneously. It sounds like a BitBucket issue rather than a file or network problem.


author: Syahrul
body: Hey [@Artur Gordashnikov](/t5/user/viewprofilepage/user-id/3615925)

Noted. Can you consistently reproduce the issue on this specific repository?

If yes, can you see if you can create a commit manually on this repository via the UI//terminal?

This should help identify the behavior if it's an API-only issue or a git terminal.

Let me know the results.

Cheers,  
Syahrul


author: Artur Gordashnikov
body: Hey, [@Syahrul](/t5/user/viewprofilepage/user-id/744536) sorry for the late reply.

The issue reproduced 9 out of 10 times. The same result was when using the UI. When using the terminal the \`git push\` almost always succeeds but takes a relatively long time, nearly one minute.


author: Artur Gordashnikov
body: After a few additional failures to create the commit with the API, my colleague gets an error when trying to \`git push\`

```
remote: error: cannot lock ref 'refs/heads/{BRANCH}': Unable to create '/opt/micros/data/cvs/vp0530/data/d-825/r-19070825/./refs/heads/{BRANCH}.lock': File exists.
```


author: Syahrul
body: Hey [@Artur Gordashnikov](/t5/user/viewprofilepage/user-id/3615925)

Thanks for the update.

I have raised a support ticket for you to continue the investigation.

You can check your ticket at the [Support portal](https://support.atlassian.com/requests/BBS-194760/).

Cheers,  
Syahrul


Tags: bitbucket-cloud

cloud
What is the project key for my project in BitBucket?
Asked by Tom Xue:

My project is on BitBucket. And due to some reason I need to find its **project key**.

As you can see from below picture, my project name is AIScreenshotAddin and its git repo link is like <https://abc.com/lvp/aiscreenshotaddin.git>. So is the abbreviation "**lvp** " is the **project key**?

![clone-project2.png](/t5/image/serverpage/image-id/223915iE7E0E2FE96D28539/image-size/large?v=v2&px=999 "clone-project2.png")

But **lvp** means "Lenovo Voice Project", as shown above. It is a **project group**, which contains dozens of projects, like below.

For each of the project, I checked their clone repo links. Everyone is like this kind:

<https://abc.com/lvp/projectxxx.git>

So **project key** represents a group of project?

I'm totally confused.

![lvp.png](/t5/image/serverpage/image-id/223914i61B384472843B7CB/image-size/large?v=v2&px=999 "lvp.png")


Answers:
author: Erez Maadani
body: You are mixing between BitBucket project and your code project.

Your \`AIScreenshotAddin\` is your code project which is your git repository in BitBucket.

Your \`Lenovo Voice Project\` is a group of your code projects so in BitBucket it's a project which is a group of repositories, which equals to a group of your code projects.

Your BitBucket project key is LVP and your git repository URL is the one you see when you hit the clone button.

One of the differences is that the git repository may include additional info (other than your source code) in order to build your code project, locally and on your CI machines. This way you can easily ensure that each commit (phase of your code project) can be build successfully, and ideally on every machine, even if you need to build old versions.


author: Fabio Racobaldo _Herzum_
body: Hi [@Tom Xue](/t5/user/viewprofilepage/user-id/5069841) ,

welcome to the Atlassian community!

LVP is the project key. A project is a container of repositories so in all repository url, the project key is part of URL.

Fabio

comments: author: Tom Xue
body: Thank you!


Tags: bitbucket-server

server
Track work/activity from user
Asked by LAL:

Is there any way to check activities taken by a user on BitBucket?

We have multiple devs constantly uploading code and I need to check the work of one of them.

I dont see any option on BitBucket to search repos or commits made by the user.

Is there any way to do this? I know this is possible on Jira and Confluence.

Currently I have no way to check if theyve done any work at all.


Answers:
author: Tharaka_Hettiarachchi
body: Hi [@LAL](/t5/user/viewprofilepage/user-id/4029771) ,

You can use Jira automation to track activities

![Screenshot 2022-11-03 at 14.02.52.png](https://community.atlassian.com/t5/image/serverpage/image-id/223933i2EB192CC78719AF6/image-size/large?v=v2&px=999 "Screenshot 2022-11-03 at 14.02.52.png")

you can trigger the rule when devs created commit and can send emails when the commit created

Cheers!

comments: author: LAL
body: [@Tharaka_Hettiarachchi](/t5/user/viewprofilepage/user-id/5038012) Anyway to do this afterwards? Those Jira automations arent helpful at this point when commits have already been made.

Besides the email spam would be enormous so that wouldnt be really a feasible solution.


author: Dan -minware-
body: Disclaimer: marketplace partner!

Hey [@LAL](/t5/user/viewprofilepage/user-id/4029771) -

If you are open to a 3rd party there are a few different ways this information is grouped in minware and we should be able to help.

Here I've expanded a Branch/PR grouping down to the commit level:

![merge_funnel_author.png](https://community.atlassian.com/t5/image/serverpage/image-id/224083i690724702F134D7F/image-size/large?v=v2&px=999 "merge_funnel_author.png")

If that doesn't get us the information we need we can try a different grouping or the Author / Repos filters highlighted in purple. Once identified you can click out to Git to see the actual work.


author: Dan -minware-
body: Hey [@LAL](/t5/user/viewprofilepage/user-id/4029771) - curious if you were ultimately able to solve for this. Wanted to let you know we recently added Bitbucket so that integration is now available in our self-serve onboarding.

Let me know if we can help!


Tags: bitbucket-cloud

cloud

commit

search

user
How to approve a Pull Request using REST API from a 3rd party application (Azure Function)
Asked by Mohan S:

Hi,

Can anyone let me know how to approve a Pull Request using REST API from a 3rd party application (Azure Function)?

It seems that the direct 'approve' option is no longer available(link below). However, the quest is, is there a work around

<https://docs.atlassian.com/bitbucket-server/rest/5.16.0/bitbucket-rest.html#idm8297609456>


Answers:
author: Erez Maadani
body: Have a look at this API: /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug} with PUT method.

According to the doc, the json you would need to send is:

    {    "user": {        "name": "charlie"    },    "approved": true,    "status": "APPROVED"}


Tags: bitbucket-server

server
Integration of Sourcetree and Bitbucket with RAD
Asked by cpotti:

Hi

I wanted to know if there is any detailed documentation of how to integrate bitbucket (server version) and source tree with RAD (Rational Application Development) IDE 9.6 version.


Answers:
author: Pradeep Kumar
body: Hi Chaitanya,

I'm on same boat Would you able to integrate BB \& SourceTree with RAD ?

Thanks in advance,

pradeep


author: bgannin
body: There is nothing specific to configure with Sourcetree, it's self-contained beyond communicating with Bitbucket Server for a few specific tasks *(listing remote repositories, creating pull requests, authentication)*

comments: author: cpotti
body: Hi

I just wanted to know if there is a documentation which would help me configure bitbucket (server version) with RAD (Rational Application Development) IDE 9.6 version.


Tags: bitbucket-server
Sync a private github repository with a non-default account
Asked by CorradoLanera:

Hi Community,

I'm new here and I would like to ask you a question:

I have two account on github, named A and B, both have private repositories. I have set the accounts and relative credentials on Sourcetree. Well while I try to sync (fetch, pull or push) private repo of the account A while A is the default account, no problem. While I try to sync private repo of the account B while B is the default account, no problem. But as soon as I try to sync a private repo of the account A while B is the default... it trow an error "repository xyz not found". So I have to go to tools/options/authentication and set A as default, come back to the main windows and now everything is working... for account A...

On the help page <https://confluence.atlassian.com/sourcetreekb/sourcetree-for-windows-1-10-0-authentication-and-accounts-updates-867186698.html> it is written that

"t is also possible to set an account as the default for a hosting service like Bitbucket. This means SorceTree uses these credentials (the username and Basic Auth password or OAuth token) when no username is specified in a Mercurial or Git URL."

And in the "remote details" pane (from the setting icon on the up-right main windows) I think I have correctly set all the information (including "username"):

remote: my_remote

URL/PATH: <https://github.com/A/xyz>

Host type: github

Host root URL: <https://github.com> (I cannot change this vale...)

Username: A

What have I miss? Can you help me to fix it?

Thank you very much,

Corrado.

System info:

- Window 10

- Sourcetree 2.4.7.0


Answers:
author: Mike Corsaro
body: Hello! Could you please try the following:

* Open the repository settings
* Select the repo path and click the "edit" button
* Change the URL / Path to: \`https://USERNAME@github.com/A/xyz\` where USERNAME is your username
* Repeat this step for the other repo with the corresponding account

comments: author: CorradoLanera
body: Following GitHub convention path: USERNAME is equal to A (isn't it?).

I did it, nothing change: if A/B is the default account everithing work for A/B but not for B/A.

Here the error returned:

```
git -c diff.mnemonicprefix=false -c core.quotepath=false fetch --prune origin
remote: Repository not found.
fatal: repository 'https://A@github.com/A/xyz/' not found

Completed with errors, see above.
```


Tags: windows
SourceTree Repository Tabs: Adjust Tab Width?
Asked by Carl Sopchak:

I was wondering if there was any way to adjust the width of the tabs across the top of the SourceTree window that show the repositories. There are about of dozen or so repos that I need to bounce between, all with relatively short names. The width of the tabs is a constant (in the current version of SourceTree), about 2x as wide as they need to be for my repo names. This causes the tabs to exceed the width of the window, so I need to scroll left/right in order to see all of my tabs, even on a maximized window.

Is there a way to adjust the tab width?

How would I make a suggestion to the SourceTree project to have the tab widths be based on the width of the text of the repo name (probably to a maximum width)?

Thanks for the suggestions,

Carl


Answers:
author: sourcetree
body: After adapting to the width, the tabs has become even uglier. Additionally, the number of pull and push labels cover the project name, making it less intuitive to use and not as user-friendly as previous versions.

comments: author: sourcetree
body: ![image.png](https://community.atlassian.com/t5/image/serverpage/image-id/263769i52494632AFA19177/image-size/large?v=v2&px=999 "image.png")


author: bgannin
body: If this is on Windows, you should file a ticket at <https://jira.atlassian.com/browse/SRCTREEWIN>

If it's on macOS we don't have any control over tabs, they are managed entirely by the OS.

comments: author: Carl Sopchak
body: It is windows. Thanks for the pointer!


author: Carl Sopchak
body: Ticket SRCTREEWIN-8318 created...
Sourcetree does not ask for password
Asked by Yusuf Osmani:

Hi, i am in as salutation where SourceTree desktop app does not ask for password after i enter my existing email ID and click on continue it remain's on same screen we are unable to proceed to login process, any idea how can i fix this.

I tried old and then latest version as well but the behavior remains same.

A quick reply on this will be most appreciated.

Regards,

Yusuf


Answers:
author: minnsey
body: Hi usually this is an issue to do with IE configuration, assuming you are talking about Windows and the registration step.  

See: <https://community.atlassian.com/t5/Sourcetree-questions/Can-t-install-SourceTree-due-to-login-problems/qaq-p/648705>

comments: author: Yusuf Osmani
body: Michael,

Many thanks for your response, i did recommended changes in IE, but no luck.

I am still on same page it keeps showing the same thing i enter my atlassian email ID and click on continue but it does not ask for password.

Is it something to do with IE version, current is 9. is it not supported? should i try upgrading it to specific version.

Please help.

Regards,

Yusuf


author: Yusuf Osmani
body: Hi Michael,

I have manage to fix it by Upgrading IE to 11 and did the IE security setting mentioned in reference link.

now i am able to go ahead with the registration process.

Once again many thank's for helping out and sharing valuable information.

hats off to you.

Regards,

Yusuf

I don't know how to close this post, anyone has access can mark as answered and close this please.


author: emeelan
body: I have this same problem on my mac...using Chrome
Unable to connect to the bitbucket repo from source tree. Fail to reload remote repositories
Asked by Suprith_Reddy:

I am using Mac High Sierra OS. I installed source tree and tried logging in by different means. I am unable to load the remote repositories on my bitbucket and also I am not able to clone them. I tried oath and ssh, and https and basic also. None of them works. I also have a windows system and it works there. On mac its a failure.

The errors are below:

An error occurred while trying to refresh the remote repository of your account.

Could not re-authorize request with the available token . please reauthenticate.

Please tell a fix for this.

Thanks,

Suprith


Answers:
author: Manju
body: Hi,

It looks like there is a problem saving password/token to keychain on you macOS. Please remove any accounts added in Sourcetree, delete all keychain items you find in Keychain that is added bySourcetree and restart you mac. Add the accounts back in Sourcetree and verify the new items added in Keychain and this should get your issues sorted out.

Thanks!


Tags: mac
cant initialise git before and now cant create branch
Asked by Ashish:

I was trying to initialize Git flow to my new project but it wasn't allowing me giving error. Then i uninstall and reinstall old source tree so now I cant see initialize Git flow option and its shows me all options New feature.....etc..

when i try to click create new feature its give me following error.

its same error when i was trying to initialize git flow.

sh.exe C:\\Users\\ashishtailor\\AppData\\Local\\Atlassian\\SourceTree\\gitflow_local\\gitflow\\git-flow feature start Theme_creation  
C:\\Users\\ashishtailor\\AppData\\Local\\Atlassian\\SourceTree\\gitflow_local\\gitflow\\git-flow: line 73: /gitflow-common: No such file or directory  
Completed with errors, see above.


Answers:
author: minnsey
body: Hi   

It sounds like the gitflow installation has become corrupted. I would suggest deleting the existing C:\\Users\\ashishtailor\\AppData\\Local\\Atlassian\\SourceTree\\gitflow_local\\ folder and re-installing Sourcetree.  

*"and its shows me all options New feature.....etc.."* From this it sounds like *git flow init* did run at somepoint.


Tags: windows