youngmon/atlassian-qna huggingface dataset:
How can my bitbucket account automatically accept repository invitations?
Asked by madprog:

Hello,

Is there a way to automatically (or programmatically) accept invitations to new repositories?

I would like people to be able to add a given Bitbucket user to their repository, so that my service can access the source code via this account, and publish the releases to an application store.

On GitHub, I can access the list of invitations via [an API call](https://docs.github.com/en/rest/reference/collaborators#list-repository-invitations-for-the-authenticated-user), and accept them via [another](https://docs.github.com/en/rest/reference/collaborators#accept-a-repository-invitation).  
For my use case, the ideal would be a checkbox on my user profile (such as *Automatically accept all repository invitations*), or similar API calls, but I could find neither (yet).

A [similar question](https://community.atlassian.com/t5/Bitbucket-questions/How-can-you-programmatically-accept-repository-invitations/qaq-p/1358764) has already been asked two years ago, but still has no answers.


Answers:
author: Norbert C
body: Hi [@madprog](/t5/user/viewprofilepage/user-id/4746509)

Thank you for contacting Atlassian Support, my name is Norbert and I'm a Bitbucket Cloud Support Engineer, it's nice to meet with you! Welcome to the Atlassian Community.

Unfortunately it's not possible to accept the invitations via the website or via API, the only way to accept invitation is via email.

Currently we have a feature request for this as you can see in the link below:

[BCLOUD-21449 - Accept Invitations in User Interface](https://jira.atlassian.com/browse/BCLOUD-21449)

Our development team will give a first-hand update on that ticket if there's any progress made so I would suggest keeping a watch and vote for it.

Do note however that there's no ETA on enhancement request, and all enhancements are implemented with this policy in mind: [Implementation of New Features Policy](https://confluence.atlassian.com/support/implementation-of-new-features-policy-201294576.html)

Please let us know if you need any further assistance.

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support


author: Pramodh M
body: Hi [@madprog](/t5/user/viewprofilepage/user-id/4746509)

Welcome to the Community!!

There is no API at the moment!!

Earlier endpoints are deprecated (<https://support.atlassian.com/bitbucket-cloud/docs/invitations-endpoint>)

Please check with Atlassian Support on what they are really doing with APIs

Here's the last update from them on the same

<https://developer.atlassian.com/cloud/bitbucket/announcement-06-08-18-new-v2-apis/>

Thanks

comments: author: madprog
body: Hello Pramodh,

I have seen the 1.0 invitations endpoint, but from what I have understood it only manages the invitations from the inviter's point of view, and only in order to create new invitations via a POST.

I have tried to invite a user, and the \`GET /1.0/invitations\` returns an empty JSON array for both the inviter and the invitee, so I guess that I cannot use this.

Thank you for your answer, though :)


Tags: bitbucket-cloud

cloud
Unable to perform git clone on linux
Asked by ecamposc:

When i try to perform a clone of my repo i'm getting this error:

Error : fatal : unable to access '<https://my_username@bitbucket.org/my_workspace/my_proyect.git>' The requested URL returned error : 403

The problem only happens with new users, old users can execute clone,push,pull, etc.

Also this only happens in my centos server, on windows works well.


Answers:
author: Pramodh M
body: Hi [@ecamposc](/t5/user/viewprofilepage/user-id/1640363)

403 --\> Unauthorized!!

Create an app password and then use the URL like this to authenticate with the repo

git clone [https://my_username:app-password@bitbucket.org/my_workspace/my_proyect.git](https://my_username@bitbucket.org/my_workspace/my_proyect.git)

Let me know if this works

Thanks,  
Pramodh

comments: author: Robert Wen_ReleaseTEAM_
body: [@Pramodh M](/t5/user/viewprofilepage/user-id/3691224) is correct. Bitbucket Cloud has deprecated using your account password for logging in via HTTPS. Here's the notice: <https://bitbucket.org/blog/deprecating-atlassian-account-password-for-bitbucket-api-and-git-activity>

New users need to create an app password and use the app password for doing git operations. Here are instructions for doing so: [https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/?utm_source=alert-email\&utm_medium=email\&utm_campaign=bitbucket-2sv-recovery_EML-12245\&jobid=105410133\&subid=1572023706](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/?utm_source=alert-email&utm_medium=email&utm_campaign=bitbucket-2sv-recovery_EML-12245&jobid=105410133&subid=1572023706)


author: ecamposc
body: Thank you so much..!!!!


Tags: bitbucket-server

server
Remote Error
Asked by danielpscheid:

Hi!

I always get an error message when trying to connect to my Bitbucket account via Sourcetree:  
Message: This endpoint has been removed. See our documentation for more information. <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-teams/#api-user-permissions-teams-get>  
Can't create remote repo anymore...

What can I do?

I can't even see my entire projects on remote...

But i can login to Bitbucket an see my whole projects...

<br />

Wired!

<br />

Thank you!


Answers:
author: Louis He
body: I got the same issue with SourceTree for Mac.

<https://community.atlassian.com/t5/Bitbucket-questions/Loading-Owners-Failed-with-Sourcetree-Mac/qaq-p/1936742>


author: bwam
body: Are there any updates on this issue? Or how to fix this?


author: danielpscheid
body: [@Pramodh M](/t5/user/viewprofilepage/user-id/3691224) any news here?


author: Pramodh M
body: [@danielpscheid](/t5/user/viewprofilepage/user-id/4746499)

Welcome to Bitbucket. It's deprecated.

Use this API --\> <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-get>

Here are the changes --\> <https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation>

Thanks,  
Pramodh

comments: author: danielpscheid
body: [@Pramodh M](/t5/user/viewprofilepage/user-id/3691224) Ok - thanks. But what should i do now? Some options in Sourcetree? Yesterday it has worked without any problems... Thanks!


author: Pramodh M
body: [@danielpscheid](/t5/user/viewprofilepage/user-id/4746499)

Try to install sourcetree again and configure the application with authenticating the remote repo


author: danielpscheid
body: [@Pramodh M](/t5/user/viewprofilepage/user-id/3691224)

Sorry - no luck... :-(

![Bildschirmfoto 2022-02-07 um 18.40.49.png](https://community.atlassian.com/t5/image/serverpage/image-id/182028iBDBC04A836EC61EE/image-size/large?v=v2&px=999 "Bildschirmfoto 2022-02-07 um 18.40.49.png")![Bildschirmfoto 2022-02-07 um 18.40.56.png](https://community.atlassian.com/t5/image/serverpage/image-id/182029i13DF0CD0E46C5548/image-size/large?v=v2&px=999 "Bildschirmfoto 2022-02-07 um 18.40.56.png")


author: Will Hayman
body: We are also having this issue. Some team-members cannot see any shared Workspace repos, and none of us can create remote repos because Sourcetree still tries to use the Owner endpoint.


Tags: atl-gruland

bitbucket-cloud

cloud

sourcetree
My Bitbucket repository is too large
Asked by Nina Lanyon:

I am using the repository as the source for netlify. Everything in the repository is generated by a script so I do not need any history.

So I have two questions:

- how can I remove everything except the current version of every file?

- Is it possible to prevent git from storing versions.

I have tried just deleting and reinitialising the local repository and doing git push --force but it made no difference to the remote.


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

I found a repository under your workspace that was over 3 GB, so I ran the GC against this repo and managed to reduce its size. Just to give you some context around the reason your repo size didn't change after you deleted some files and pushed it, the remote repo still had the old references as well, so the GC is required on the remote repository to clean up any old references you have removed.

Answering your question about how to remove everything except the current version of every file, I recommend that you use [BFG Repo-Cleaner](https://rtyley.github.io/bfg-repo-cleaner/) to achieve that. The following documentation has a very good explanation on how to proceed with that:

* <https://support.atlassian.com/bitbucket-cloud/docs/use-bfg-to-migrate-a-repo-to-git-lfs/>

I also would like to share with you that we 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).

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

Kind regards,   
Caroline


Tags: bitbucket-cloud

cloud
Is there a way to have a rework state that isn't a pull reject but isn't an accept yet?
Asked by David Goldman:

Pull request comments ask for a change that takes a bit. Every reviewer sees the push notifications getting the suggestion addressed and none know if it is ready to re-review. Email is sent to hold off until I am done, etc..

Is there a way to move a pull request to a rework state until ready?


Answers:
author: Fabio Racobaldo _Herzum_
body: Hi [@David Goldman](/t5/user/viewprofilepage/user-id/4746432) ,

"Change Requested" status should help you on that.

Please, take a look to the following article <https://bitbucket.org/blog/a-new-status-for-pull-requests-in-bitbucket-cloud-changes-requested>

Hope this helps,

Fabio

comments: author: David Goldman
body: We have tasks assigned when there are expectations in a pull before merging.   
"Change requested" is not all inclusive. There are questions or comments that require response even if it isn't a requested code change.  

If the requested changes are addressed, it doesn't mean all the questions and comments have been responded to or that the overall changes are complete beyond the specific change requested.

If the reviewers put a task or change request on every comment then this would work. They don't because that isn't obviously a requirement.

It would still benefit to have an explicit state for reworking.

Also, in our particular setup, there is no declined, only rejected and pulls cannot be reopened. A new one is needed and the comment history is in the old pr. Awkward.  


Tags: bitbucket-cloud

cloud

pull-request
App Password/Python
Asked by ariella:

I am using Python to log into my Bitbucket Repository, using an app password.

I have reviewed the documentation for the Python Bitbucket module (<https://atlassian-python-api.readthedocs.io/bitbucket.html>), and I'm not sure what the project_list and project_key, and how to find them.

When I try to run 'bitbucket.project(key)', I get the error 'NameError: name 'key' is not defined'  

What is the project(key) in a bitbucket repo?


Answers:
author: Pramodh M
body: Hi [@ariella](/t5/user/viewprofilepage/user-id/4745912)

Welcome to Bitbucket!!

Please verify this is the Project key you are passing (Example shown here)

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

Thanks,  
Pramodh

comments: author: ariella
body: Hi [@Pramodh M](/t5/user/viewprofilepage/user-id/3691224) ,

Thanks for the comment!

Ok, I see the Project Key in my Bitbucket:  
![Screenshot 2022-02-07 152329.png](https://community.atlassian.com/t5/image/serverpage/image-id/181984i249ADC7C1C663E11/image-size/large?v=v2&px=999 "Screenshot 2022-02-07 152329.png")

So what is the proper code to get into a project folder?

x = Bitbucket.repo_list('AI')  
print(x)  

<br />

Or something else?


Tags: bitbucket-cloud

cloud

password

python
Mirror repository from BitBucket Cloud to Google Cloud Repository for App Password changes
Asked by Chee Hwee Chai:

Hi all,

with the upcoming changes as outlined in

<https://bitbucket.org/blog/deprecating-atlassian-account-password-for-git-and-bitbucket-api-activity>

How does it affect mirroring a Bitbucket Repository to Google Cloud Repository? I noticed that in the instructions in Google <https://cloud.google.com/source-repositories/docs/mirroring-a-bitbucket-repository> , the credentials used during logging in to Bitbucket are the account email and password, not the username and app password.

Does anyone have an idea whether things will break and what changes are required to get mirroring working?


Answers:
author: Caroline R
body: Hi, [@Chee Hwee Chai](/t5/user/viewprofilepage/user-id/3542707), thank you for reaching out to Atlassian Community.

I understand your concern, but don't worry, things shouldn't break and you don't have to do anything about your mirror repository in Google Cloud Repository.

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

Kind regards,  
Caroline

comments: author: Chee Hwee Chai
body: Thanks Caroline!


Tags: bitbucket-cloud

cloud

password
what need to be used in branch name in order to replace the "/" in bitbucket API url
Asked by Niveen Azaiza:

I have tried %2F to replace the "/" character that appears in branch name which is composed of two parts (release/branch name) and didn't succeed.

In request appears "release" without the "/branch name".Seem like using the %2F cut the input.

My question if there is any special character to replace the "/" in branch name in bitbucket API URL


Answers:
author: Theodora Boudale
body: Hi [@Niveen Azaiza](/t5/user/viewprofilepage/user-id/4735225),

This issue is related to the following bug:

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

I don't think that the slash can be replaced with a certain character, but there may be a different way to work around this issue.

Could you please let me know which API endpoint you are using so that I look into it?

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Can't Ping Slack
Asked by rajaramrprg:

Hello, I have a bitbucket server that is installed on a local machine(192.168.1.11) Trying to integrate Slack with an official plugin.

It is failing for a reason but can't find it. This endpoint returns 400 bad requests.

http:192.168.1.11:7990/rest/slack/latest/connection/can-reach-slack


Answers:
author: Pramodh M
body: Hi [@rajaramrprg](/t5/user/viewprofilepage/user-id/4745647)

Welcome to the Community!!

This is because you have installed the Bitbucket server that is installed in a system where the internet cannot reach the server!!

Try installing it in a Linux server on cloud platform, where your internet can reach through the server, or try having that configuration via routing.

If it is your on-premise machine, try having a word with IT Admin

Thanks,  
Pramodh

comments: author: rajaramrprg
body: hi Pramodh,

Thank you for considering the issue,

yes, I had the same doubt that it may be an internet issue, to verify I tried ping on google.com, it was pinging, to the reference I attached the screenshot.![ping_server.png](https://community.atlassian.com/t5/image/serverpage/image-id/181943iF6120C612A0A4675/image-size/large?v=v2&px=999 "ping_server.png")


author: Pramodh M
body: Yeah, You can reach the internet, but this is reverse!!

Internet can't reach your machine!!


author: rajaramrprg
body: Thank you, we will open the connection, may I know which port needs to be opened on the local machine to allow slack to connect back.

Thanks in advance,

Rajaram


Tags: bitbucket-server

slack
Use a remote repository that is personally hosted without cloning it?
Asked by Exia:

At work we have an central git repository for our web app, and each developer has a clone of it on a VM where they do work. Is there a way to connect Source Tree to the remote repository without making a local clone of that repository?


Answers:
author: Seth
body: Short answer, no.

Thechnically, you could mount the remote repository as network storage, but this is error prone. See this question, and the others linked from it: <https://answers.atlassian.com/questions/275021>

comments: author: Exia
body: Thanks for the quick response. Would you happen to know of git gui that has this feature or if its planned for SourceTree?


author: Seth
body: It's not a Git GUI problem, it's a Git problem. The foundational, command-line software is the source of those errors. The developers of Git would probably tell you that trying to manage a git repository on network storage is exactly what git was designed to avoid, regardless of your specific situation.Regardless, someone could, theoretically, develop a Git GUI that connected to a remote server over SSH and issued Git commands there. I don't know of any though.


Tags: repository
set password for repository
Asked by JonDaniel:

In sourcetree, how do you set a password for a particular repository - it's not prompting, I just get:

Access denied  
Access denied  
Access denied  
Access denied  
Access denied  
Access denied

FATAL ERROR: Server sent disconnect message  
type 2 (protocol error):  
"Too many authentication failures

That's great, but there doesn't seem to be anywhere I can actually set the repository password, and it's not prompting for it?


Answers:
author: JonDaniel
body: Found it, it's in options -\> authentication - delete your saved credentials and it'll reprompt on next fetch / pull

comments: author: Seth
body: For posterity, Mac or Windows?


author: JonDaniel
body: Windows.
Sourcetree cannot find my git installation, how to fix?
Asked by Danny F:

I'm running sourcetree in win8.1. I have a git installation (I can bash it, it works). But Sourcetree refuses to detect or BROWSE (wtf?) my git installation. What can I do?

Thanks!


Answers:
author: Seth
body: Is SourceTree currently trying to use "System Git" or "Embedded Git". If you've got your own git installation, System Git is what you want. If you've got that set and it's not working, check whether git is on your PATH.

comments: author: Danny F
body: That did it, thx!


Tags: configuration

git

install
'git log' failed with code -1:'launch path not accessible----- how can I solve this problem?
Asked by Lily LI:

my sourcetree got some error when I try to open my repo:'git log' failed with code -1:'launch path not accessible

I am not sure whether I made a mistake in deleting some file to cause this thing, anyway ,now how can I do to solve this error?


Answers:
author: Michael Hawkins
body: I didn't have to reinstall git I just had to tell SourceTree what git executable to use. I'm on OSX Yosemite (10.10.3) with a Homebrewed git install so I opened SourceTree and navigated to SourceTree...Preferences and selected the Git Tab. I then clicked "Use System Git" and navigated to /usr/local/Cellar/git/2.3.5/bin/git.

comments: author: jd_dhang
body: thanks!


author: JJ Bates
body: Worked for me! Thank you!


author: David Pellegrini
body: Worked for me, too. Hooray!


author: GriehleNEF
body: Fantastic explanation of the fix.


author: pix
body: went to preferences, git, clicked the system git button, it automatically opened the right path, clicked on git, thats it, fixed.. osx catalina


author: Ayse BIROL
body: this worked for me too. thanks..


author: Patrick Melo
body: I experienced this with the upgrade to Ventura 13.0.1 also. "Use system git" fixed the problem. Thanks!


author: Bal?zs Szakm?ry
body: If you reinstall Git (no need to uninstall it first, just start the installer again), any accidentally removed files will be put back. (In SourceTree, make sure you are using the system Git, not the embedded one. The option is in Tools\\Options\\Git.)

comments: author: Lily LI
body: reinstall Git?which didn't cause my current repos disappear? I already built many repo in sourcetree and used them for a long time, until recently I just clear some trash for my hd , after that, when I open any repo, then show the error I posted in the title


author: Bal?zs Szakm?ry
body: Reinstalling Git will not change your clones in any way.


author: Seth
body: When you say you cleared trash, did that trash include ".git" folders? If so, you've deleted your repositories, and you'll have to re-clone then from your remotes. Your working copy should still be present, so you can use that to recover any changes that weren't pushed to the server.


author: Bal?zs Szakm?ry
body: You cannot clone into a non-empty folder, so if you do this, you need to create new clones and overwrite the working copy with the current set of files.


author: Chris Marabate
body: I have the same exact issue with Sourcetree and when I go to Tools\\Options\\Git under Git Version, the "System" button is grayed out. I was just trying it out to see if I liked it better than GitHub Desktop and it seems like it might be but it is so much more difficult to get setup correctly and I lost my patients with it.

I give up for now but if somebody is able to help me on here I will give it another chance.


author: CI User
body: This can also happen with latest SourceTree if git is reinstalled. Sadly SourceTree fails the ability to detect fit installed on /usr/local/bin/git -- which happens to be the default location for git when installed with homebrew on MacOS.
Can i get the install for windows 1.6.13? Upgraded to 1.6.14 yesterday and it wont open, keeps crashing. Windows 7 machine
Asked by B Doyle:

Upgrdaded yesterday to 1.6.14 on windows 7 machine, keeps crashing. have uninstalled and reinstalled, even tried 1.5.2 version, same problem. looking to install the 1.6.13 version. Do you have the install? any ideas?


Answers:
author: B Doyle
body: Solution: I deleted all the files in appdata\\local\\temp and now it works. I am running the latest version 1.6.14 too


author: fubz
body: I am also having this issue. See attached log

<br />

sourcetree.log  
[](/tnckb94959/attachments/tnckb94959/sourcetree-questions/12182/1/sourcetree.log){#display_116a8deafc4672_0}

comments: author: B Doyle
body: deleted all files in appdata\\local\\temp and now it works


author: fubz
body: It is still crashing upon startup for me. It must be different causes. Thanks though.


author: Volodymyr Krupach
body: I believe it's something with you Windows. Do you get any errors?

comments: author: B Doyle
body: deleted all files in appdata\\local\\temp and now it works.
fatal: Unable to create '...index.lock': Permission denied
Asked by William Melatini:

hi, i'm trying to use sourcetree to manage my local mamp pro site. so with git and sourcetree installed i use my local development directory as a workging-directory. when i try to check unstaged file i get this error:

fatal: Unable to create 'developmentsite.dev/.git/index.lock': Permission denied

i check the permision on this directory and the mac user (me) and _www user (mamp pro) can write and read on this directory.

so what can i do to resolve the problem?


Answers:
author: Shivali Bari
body: I was having same issue. try to execute commands as root user. When I tried git checkout it was not working. But when I used it with **sudo** it worked!

comments: author: vlad-004
body: thanks bro, it realy work !!!


author: William Melatini
body: On the web the issue is that index.lock is still exist. My problem is that i can't create this file for a permission issue.


author: Seth
body: <http://lmgtfy.com/?q=git+index.lock>

comments: author: William Melatini
body: On the web the issue is that index.lock is still exist. My problem is that i can't create this file for a permission issue.


Tags: permission