youngmon/atlassian-qna huggingface dataset:
Hii Actually My question is about bitbucket server
Asked by Akash Kaaa:

I want to create a custom merge check which will check for jenkins particular stage is executed or not.

My approach this problem is making a rest api call to jenkins server about build logs, based on logs I will take decision whether should I accept/reject the pull request.

So my questions are

Can I make a Rest Api call inside custom merge check?

What is the way to create custom merge check?


Answers:
author: Erez Maadani
body: You can install apps/plugins that possibly can give you this ability.

Have a look here: <https://marketplace.atlassian.com/addons/app/bitbucket>

I believe that you can also try and write your own and I know there are some plugins which enables you to write scripts.

comments: author: Akash Kaaa
body: Thank you for response..

Actually Iam also looking at same solution as you suggest.. Thinking about Script Runner plugin..

Also it will be helpful if you share any resource on creating a bit bucket server plugin..


author: Erez Maadani
body: These links might help:

<https://developer.atlassian.com/server/bitbucket/how-tos/beginner-guide-to-bitbucket-server-plugin-development/>

<https://docs.atlassian.com/bitbucket-server/docs/5.8.0/tutorials-and-examples/bitbucket-server-tutorials.html>

<https://bitbucket.org/atlassian/bitbucket-server-example-plugins/src/master/>


Tags: bitbucket-server
Backup process of source code in bitbucket and how the restoration is done for a workspace.
Asked by ITHELP:

The backup process of source code in Bitbucket and how the restoration is done for a particular workspace or a repository in case of any unexpected deletion.

How can we retain the backup file and what is the procedure?


Answers:
author: Syahrul
body: Hi [@ITHELP](/t5/user/viewprofilepage/user-id/5056326)

Welcome to the community!

I believe our KB below has all the information needed regarding how Bitbucket backup your repositories:

[Does Bitbucket backup my repositories?](https://support.atlassian.com/bitbucket-cloud/docs/does-bitbucket-backup-my-repositories/)

That said, do note that our backups are for disaster recovery purposes only. We cannot use our backups to restore repositories that an end user has deleted.

However, On rare occasions, our Support team can help recover core repository content only, as long as the deletion happened within the last 7 days. We are unable to recover metadata or any content that was deleted past 7 days.

Cheers,  
Syahrul


Tags: bitbucket-cloud

cloud
Best practices when it comes to archiving and deleting repos from Bitbucket?
Asked by Tahsin:

I am trying to archiving and delete some of the repos from BitBucket but what are standards I should follow or things to keep in mind?


Answers:
author: Sebastian Krzewi?ski
body: Hi [@Tahsin](/t5/user/viewprofilepage/user-id/5055922)

I always try to backup data somewhere. In company we have special place and team that help us with that. When backup is ready I delete it from application. Also good practise is to set data retention for those backups. I don't see the point to still store 2 or 3 years backup. Of course in situation that company require storing backups for x months/years I need to remember about that.

Regards,

Seba

comments: author: Tahsin
body: Thanks [@Sebastian Krzewi?ski](/t5/user/viewprofilepage/user-id/1561725) but is there standards or things to keep in mind for archiving repos?


author: Sebastian Krzewi?ski
body: I think you need to think about it and decide what is important for you and set it as a standard for those repositories.
Run GC
Asked by H?ctor Fenoll Malonda:

Hi

Please run garbage collection on our salesforce repository (<https://bitbucket.org/hotelbeds-cloud/salesforce/src/master/>)

Could you execute it at 00:00 GMT?

Thanks, best regards


Answers:
author: Fabio Racobaldo _Herzum_
body: Hi [@H?ctor Fenoll Malonda](/t5/user/viewprofilepage/user-id/4789664) ,

this request should be raised to <https://support.atlassian.com/contact/>

Fabio

comments: author: H?ctor Fenoll Malonda
body: Ok, thanks!!


author: Bhanu
body: Please reach out to the Atlassian support at support.atlassian.com, they should be able to help you out.


Tags: bitbucket-cloud

cloud
Running pipeline steps on different self hosted runners
Asked by Andrew Grafham:

I'm trying to get a build of a C++ application to run simultaneously on Windows and Linux but have run into some difficulties with the output displayed in the bitbucket web interface.

I'm using the following bitbucket-pipelines.yml file as a test:-

```
pipelines:
  default:
    - step: 
        name: Windows Test1
        runs-on: 
          - 'windows'
          - 'self.hosted'
        script:
          - echo "This is a test"
    - step: 
        name: Linux Test1
        runs-on: 
          - 'linux.shell'
          - 'self.hosted'
        script:
          - echo "This is a test on Linux"

```

but the output in bitbucket cloud is only showing the output from first step. It's reporting the build was successful, and it does seem to have run on Linux, but the output on the bitbucket cloud page under "Pipelines" only shows the windows part of the build.

![Screenshot 2022-10-17 101723.png](/t5/image/serverpage/image-id/221030i3DF9CBA2EBF9B74A/image-size/large?v=v2&px=999 "Screenshot 2022-10-17 101723.png")

Is this a bug in Bitbucket Pipelines or am I doing something wrong in my .yml file?

Thanks


Answers:
author: Andrew Grafham
body: Ignore this question - I've figured out the issue now. I'd managed to collapse the part of the page that allows you to select which step you want to see the output of.


Tags: bitbucket-cloud

bitbucket-pipelines

cloud

server
Trigger action in nodeRed on failed pipeline
Asked by Mikka Kummer:

I'd like to send a signal (MQTT?) to a node Red server when a pipeline fails, I'm not sure if a pipeline can send MQTT signals directly or if there needs to be a work around


Answers:
author: Patrik S
body: Hello [@Mikka Kummer](/t5/user/viewprofilepage/user-id/5055355) ,

Welcome to the Atlassian Community!

In bitbucket pipelines, we basically provide you with a linux container where you can essentially execute the same shell commands and scripts you execute locally.

So if you have a script or an MQTT CLI that you use locally to send signals to an external server, you should be able to execute the same commands in the pipelines, as long as you install these dependencies/programs in the docker image you are using in your build.

There are already some images in Dockehub which implements MQTT, such as the [Eclipse-Mosquitto](https://hub.docker.com/_/eclipse-mosquitto) , which you can use in your build step. However, you also have the option to [build your custom image](https://support.atlassian.com/bitbucket-cloud/docs/use-docker-images-as-build-environments/#Custom-build-environments) with all the dependencies your project needs, including, for example, an MQTT CLI to connect to your external server.

Hope that helps! Let me know in case you have any questions.

Thank you, [@Mikka Kummer](/t5/user/viewprofilepage/user-id/5055355) .

Kind regards,

Patrik S

comments: author: Mikka Kummer
body: Thanks for your quick reply, this already helped a lot.

I'm not quite sure how I can check if something/what fails in the pipeline and how I can react to the error with my script

Kind regards, Mikka Kummer


author: Patrik S
body: Hello [@Mikka Kummer](/t5/user/viewprofilepage/user-id/5055355) ,

You can first try to run your build locally in a docker container, to simulate the same environment as pipelines. We have the following tutorial on how to run a build locally:

* <https://support.atlassian.com/bitbucket-cloud/docs/debug-pipelines-locally-with-docker/>

once you have everything tested and set up locally, you can use the same commands and docker image to configure your bitbucket-pipelines.yml file and run it in the pipelines infrastructure.


Tags: bitbucket-cloud

bitbucket-pipelines

cloud
User unable to receive email invitations
Asked by Jad Sanaknaki:

There's a new user that I would like to add to a team space . However, this time the new user hasn't received anything. I tried to resend in user management tab for several times, and he carefully checked all the mail boxes, there's no invitation mail.


Answers:
author: Syahrul
body: Hi Jad,

Welcome to the community!

I would require the user's email address to investigate, and since this is Public, I'll raise a Support ticket on behalf of you to avoid sharing the user's email address publicly.

You can view the ticket in our Support portal [here.](https://support.atlassian.com/requests/)

Cheers,  
Syahrul


Tags: bitbucket-cloud

cloud
Can I configure SourceTree to prompt for user credentials on start or activity?
Asked by Jeremy Marquis:

I have client computers that I want to require the entry of user name and password before they can interact with the remote. I want it to be one of our developers who does any pushing/pulling, not a lab tech. Ideally, they also could not "add a new repo" and see the list of repos (my other clients) on Bitbucket. If there is a better approach I am open to it.


Answers:
author: minnsey
body: Hi  

I'm assuming this is Sourcetree for Windows and that Sourcetree does **not** provide the kind of fine grained control you are looking for.  

If you delete any Accounts in Tools/Options/Authentication then Sourcetree will not be able to list remote repos on Bitbucket.  

If you are using private repos anyone trying to push will be prompted for valid credentials, but by default Git will cache those credentials for use the next time.  

You can turn off this caching, see <https://git-scm.com/docs/gitcredentials>  

*If `credential.helper` is configured to the empty string, this resets the helper list to empty (so you may override a helper set by a lower-priority config file by configuring the empty-string helper, followed by whatever set of helpers you would like).*   

This potentially would prevent caching and mean the use is prompted everytime ... but Sourcetree expects the standard git credential manager to be in place and working to manage the credentials. I've never tried this but I suspect it will prevent pushing/pulling from Sourcetree but you might need to switch to the command line when you do actually want to enter credentials and push to the remote.
Cloning from Sourcetree is hanging trying to check repository type (basic and oauth)
Asked by jerrya:

Using the 2.3.5.0 version of Sourcetree on Win 7 64, using both basic auth and oauth, when I try to clone a remote (shared) repository, "Clone" just seems to hang with a spinning loader as it seemingly tries to determine the repository type "Checking source"

![U7318rF](/t5/image/serverpage/image-id/10324i50823E38F374B88C/image-size/large?v=v2&px=999 "U7318rF")


Answers:
author: Emman Jay Dizon
body: same issue on source tree right now. stuck on checking source


author: jerrya
body: Hi Mike,

Nope, no pop ups.

Sourcetree is using System Git version 2.14.2/LibGit2Sharp 0.24.0


author: minnsey
body: Hi  

Do you get any dialogs popping up asking for authentication/credentials?  

Can you check that you are using a version of git \>= 2.13 in Tools/Options/Git

comments: author: jerrya
body: Hi Mike,

Nope, no pop ups.

Sourcetree is using System Git version 2.14.2/LibGit2Sharp 0.24.0


author: minnsey
body: Hi  
Hmm.  
I'm guessing you can clone from the command line?  
You don't have any proxies in the way do you?


author: jerrya
body: Yes, cloning is fine from the command line. And no proxies.
Easiest path to reducing the size of a repository?
Asked by MrConkin:

Hi, I've hit the 4GB limit with my repository and am seeking a path to reduce that size while ensuring that my most recent changes are safe.

In going through the documentation steps (<https://support.atlassian.com/bitbucket-cloud/docs/reduce-repository-size/>) I have done the following:

- Created a temporary branch with my latest commit

- Reset my master branch back to the previous commit

However at this stage I am uncertain how to proceed with reducing my repository size so I can continue making changes. My older changes do not matter to me, it is just important that my most recent commits are backed up. Is there a way to clear my data prior to a provided commit or something along those lines?


Answers:
author: Theodora Boudale
body: Hi [@MrConkin](/t5/user/viewprofilepage/user-id/1551701),

You mentioned that you started with a new repo without the history and abandoned the old one.

In case you would like to continue with the old repo with the history, I can see the repo that was over the 4 GB size limit. I ran a garbage collection to this repo and its size is 2.8 GB now, so you should be able to push to the repo.

The repo's size is still quite large, so I would suggest reducing it further, if possible. You can check this reply of mine here:

* <https://community.atlassian.com/t5/Bitbucket-questions/Revert-bitbucket-repository-state-to-one-day-prior/qaq-p/1908360#M76762>

If you decide to rewrite history with BFG to further reduce the repo's size, please keep in mind that the repo's size will get increased again when you push these changes, and the remote repo will need another git gc. I can run it for your repo again then, so that the repo's size gets reduced, just let me know.

Kind regards,  
Theodora

comments: author: MrConkin
body: That's very helpful, thank you Theodora. I think I will stick with the new repo so I can start fresh with a stringent gitignore. Appreciate the help and offer though.


author: Theodora Boudale
body: You are very welcome. If you change your mind or if you have any other questions in the future, please feel free to reach out!


author: Johannes Kilian
body: You might have a look at following solution:

[How to push a shallow clone to a new repo?](https://stackoverflow.com/questions/50992188/how-to-push-a-shallow-clone-to-a-new-repo)

comments: author: MrConkin
body: Hi Johannes, thanks for the lead.

That process was going relatively smoothly. I created a shallow clone and a new BitBucket repo, but when I attempt to push the clone to the new repo I get this error. Any advice on how to bypass this would be appreciated.

![shallow.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/221147iDA87A5D9EF6B4718/image-size/large?v=v2&px=999 "shallow.PNG")


author: MrConkin
body: Abandoned that plan and ended up just starting fresh with my latest in a new repo as per:

<https://stackoverflow.com/questions/30001304/clone-git-repository-without-history>


Tags: bitbucket-cloud

cloud
View all local repos in a sidebar?
Asked by Andrew Aversa:

In previous versions of SourceTree, there was an extremely helpful sidebar where I could view ALL my local repos. This was so useful in navigating as I work with over 20 repos and often need to jump around from one to another.

As of v2.0 (I am on the latest version now) this sidebar is totally gone and I don't see how to bring it back. The tab view is really frustrating, since the tabs take up a lot of horizontal space and thus I can't see all repos at once.


Answers:
author: Ana Retamal
body: Hi Andrew! That change was implemented in version 2.0 and was announced at [Sourcetree for windows 2.0 is now in beta](https://blog.sourcetreeapp.com/2017/01/27/sourcetree-for-windows-2-0-is-now-in-beta/ ).

We have a Feature request to bring back the bookmark view, you can vote for it at [SRCTREEWIN-7841](https://jira.atlassian.com/browse/SRCTREEWIN-7841).

Hope that helps!

Ana
Problem with remote repositories
Asked by S.A.U. Qbed Consulting:

Hi,

I'm the owner of some repositories and I've created a group to acces this repositories.

The problem is that the user of that group, can't view the repositories when they connect to sourcetree.

Also If they try to find the repositories, no result is shown.


Answers:
author: Ana Retamal
body: Hi! Has that user tried to access the repos directly in Bitbucket Cloud? If he can see them in Bitbucket but not in Sourcetree, can you confirm he followed the steps as explained at [Clone a repository](https://confluence.atlassian.com/sourcetreekb/clone-a-repository-into-sourcetree-780870050.html) and give us the following information:

- Describe how is he trying to add them

- Screenshot of the process

- Is he getting any error message

Best regards!

Ana

comments: author: S.A.U. Qbed Consulting
body: Hi this is what my coleguee see in bitbucket and sourcetree:

![1.png](https://community.atlassian.com/t5/image/serverpage/image-id/10429iF87B16BD91A63A61/image-size/large?v=v2&px=999 "1.png")![2.png](https://community.atlassian.com/t5/image/serverpage/image-id/10430iE0C7F19C966FA84C/image-size/large?v=v2&px=999 "2.png")The problem is that in sourcetree he can't see the repos


Tags: bitbucket

bitbucket-cloud
Clone for large LFS project very slow on windows
Asked by Peter Cardwell-Gardner:

Cloning a large repository with \~4gb of LFS files is incredibly slow on windows (sourcetree 2.3.5). There are \~10k files, being pulled from a central repo on the network.   

If I perform \`git lfs fetch\` from the command line or do a clone in OSX sourcetree it gathers all LFS files in about 10-15 minutes. In comparison souretree on windows took 25 minutes to just get to 15% of files (an order of magnitude slower). Also looking at the output it seems like osx is doing a \`git lfs fetch\` in the background (can see a summary printed in the command line), whilst windows seems to be doing an operation on every single file. (every single file spawns and logs an entry in the progress window). My understanding is that sourcetree should skip filter smudge when it clones, but it seems this might not be the case on windows?   

From the progress window in sourcetree for windows:

```
git -c filter.lfs.smudge= -c filter.lfs.required=false -c diff.mnemonicprefix=false -c core.quotepath=false clone --branch master ...
```

<br />

<br />

Not quite sure how to interpret if this is correct


Answers:
author: minnsey
body: Hi  

Thanks for the report, I don't have an answer but we can look into it.  

Just to clarify, this is from an internal self hosted repository not from an online host like Bitbucket or GitHub?

comments: author: Peter Cardwell-Gardner
body: Yeah, it is internal self hosted (gitlab) on a network LAN. Further fetch operations seem to happen a reasonable speed. It's just the clone that's borked


author: minnsey
body: Thanks for the additional information\>  

Can you post the console window output?  

I'm not completely clear how you feel it is different. Sourcetree just issues a single clone command, although the output does include a file by file output.


author: Mahesh Khambadkone
body: Hi [@minnsey](/t5/user/viewprofilepage/user-id/502201) , Curious if this was ever resolved ? I have been using a Mac for the past 5 years with Sourcetree, and clones of a 2GB repository would take upto 15 minutes.

I've had to use a Windows of late, and the clone is endless ; with antivirus disabled, the same repsitory is already cloning over 2 hours. Lots of lines of "Filtering content: xxx% " indicating it's fetching the lfs content. But this is unusually long ; both systems are on the same network.

Are there any suggestions you may have as to what can cause this slowdown?


author: minnsey
body: Hello [@Mahesh Khambadkone](/t5/user/viewprofilepage/user-id/972070)   

I'm afraid I'm no longer a member of the Sourcetree development team, as such I'm unable to answer the question, sorry.
How do I fix??? Error pushing to remote?
Asked by Richard Albrecht:

git -c diff.mnemonicprefix=false -c core.quotepath=false -c credential.helper=sourcetree push -v --tags --set-upstream MemberTree1 refs/heads/HEAD:refs/heads/HEAD

Pushing to https://Hawkcode@github.com/Hawkcode/MemberTree1.git

error: src refspec refs/heads/HEAD does not match any.

error: failed to push some refs to 'https://Hawkcode@github.com/Hawkcode/MemberTree1.git'

Completed with errors, see above

Using Mac High Sierra and Sourcetree 2.6.3 (164)


Answers:
author: Ana Retamal
body: Hi Richard, have you tried the command line to see if you get the same error? This will help us identify if this is an issue with Sourcetree or with something else.

One of the reasons why you might be receiving this error is because you haven't committed anything to your repo yet. Is this your case? If it is, you can do so by:

    git commit -m "initial commit"git push origin master

This is also documented in [this Knowledge base article](https://confluence.atlassian.com/bitbucketserverkb/src-refspec-master-does-not-match-any-error-when-pushing-to-repository-788727186.html).

Let us know if this helped!

Best regards,

Ana

comments: author: Richard Albrecht
body: This project has hundreds of commits. I really don't know the command line, hence Source Tree.

I must of done something when I did the commit to cause this but I don't know what.

Thanks


Tags: push
My friend (account email is sfanonymous123@gmail.com) can't log in
Asked by Lane Davis:

When she tries to log in using Sourcetree, she is told she sent a malformed request.


Answers:
author: Ana Retamal
body: Hi Lane! We'll need more info to know why is this happening:

1. Which Sourcetree and OS version is she using?
2. Is this happening during registration, or is she trying to authenticate for a new repo?
3. Can she try logging in directly in the browser (if she uses Windows, she needs to try IE)?
4. Can you send a screenshot of this error message she's getting?

Cheers :)

Ana

comments: author: Lane Davis
body: Hey Ana,

Thanks for the response! My friend actually figured things out. Just in case it's useful for anyone else, here's what we did:

1. Since Sourcetree was opening IE windows for login, we assumed that the issue must be with something in IE.
2. We went into IE and deleted all history/cookies.

After doing this, Sourcetree successfully let us log in.

Cheers to you and your great community!

Lane


author: Ana Retamal
body: Hi Lane, glad to hear that! And thanks for sharing your solution, this is how the Community grows! ?

Have a good day!

Ana
How do I get the full path in title bar of Sourcetree
Asked by S?bastien Tardif:

The title bar is very large but it only show one folder name, and I have 4 Sourcetree open on different 'folder tree' ending up with all the same folder name. I have difficulty to know in which Sourcetree instance/window I'm.

How can I get the title bar and then also the list of instance/window on Mac to have more context to be able to make a selection?

![Screen Shot 2017-11-30 at 5.05.41 PM.png](/t5/image/serverpage/image-id/10257i1234C35333A13D94/image-size/large?v=v2&px=999 "Screen Shot 2017-11-30 at 5.05.41 PM.png")


Answers:
author: bgannin
body: Bookmarked repositories show their "display name" instead of the path's last component. You can rename a bookmark from its contextual menu. So you could name them Phase 1, Phase 2, Phase 3 using the Repository Browser without changing what's on disk.

If you need to confirm which is which there's the macOS trick of Cmd+clicking on the title in the window's titlebar which shows a hierarchical menu of the file's path.

Brian Ganninger  
Senior Mac Developer, Sourcetree

comments: author: S?bastien Tardif
body: Thanks for these two workarounds. I will make use of both of them.

Still, lot of application have this options of getting the short or long name, and that title bar is very empty right now. Please add the option of getting the full path on the title.

Also, if you think identifications should be more based on 'bookmark' the bookmark could be also with the folder name on the title.