youngmon/atlassian-qna huggingface dataset:
Can we use pipe inside custom pipe ?
Asked by Narendra:

Hi Team,

We are creating our custom pipe using Python/Bash.

We want push images to ecr as one of task which we have in our custom pipe, there is aws-ecr-push pipe is available.

Can I use existing pipe inside my custom pipe. If yes, Can you please point me.

**Appreciate your help.**

**Thanks**

**Narendra**


Answers:
author: Oleksandr Kyrdan
body: Hi [@Narendra](/t5/user/viewprofilepage/user-id/5101426)

Thank you for your question!

If I understand you correct, there could be the next cases:

1) implement your workflow logic in multiple files and combine them with the pipe accordingly:

```
- step:    oidc: true    script:
      # <do some pre-build logic>      # build the image      - docker build -t my-docker-image .

      # <do some additional logic here>
      # <./run.sh execute some shell scripts here>      # use the pipe to push the image to AWS ECR      - pipe: atlassian/aws-ecr-push-image:1.6.2        variables:          AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION          AWS_OIDC_ROLE_ARN: 'arn:aws:iam::123456789012:role/role_name'          IMAGE_NAME: my-docker-image

```

2) or if you want to extend/modify the pipe functionality you could write own [custom pipe](https://bitbucket.org/blog/build-flexible-ci-cd-pipelines-with-custom-pipes) and use inheritance. A good example is [here](https://bitbucket.org/atlassian/aws-sam-deploy/src/70146b43fdd495dfa58e83fd1b46276aa07c23aa/sam_pipe/core.py#lines-70).

Welcome to share your experience with the community.

Best regards,  
Oleksandr Kyrdan

comments: author: Narendra
body: Hi Oleksandr,

Thank you for your response, Im looking in following way as my custom pipe.

1. bitbucket-pipeline.yml

====================

```
- pipe: <company_repo>/<company-ecr-custom-name-pipe>:<version>        variables:          AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION          AWS_OIDC_ROLE_ARN: 'arn:aws:iam::123456789012:role/role_name'          IMAGE_NAME: my-docker-image
          OPERATIONS : ["PUSH", "RESTART"]
          KEY1 : VALUE1
          KEY2 : VALUE2
            
```

2. Custom Pipe should able to do push when user:

Ex:

My custom pipe should use internally, aws-ecr-push-image:1.6.1 pipe, if user given PUSH in OPERATIONS variable.

```
- pipe: atlassian/aws-ecr-push-image:1.6.2
```

I hope above example gives what I'm looking. Please let me know in case if you require more details.

Appreciate your pointers


Tags: aws

bitbucket-pipelines

cloud
Why BitBucket Cloud is showing a different size than my local repo?
Asked by MCSAEP:

Hi,

I need help again ASAP to run the git gc on our 3 remote repos stored in my bitbucket cloud because I already did all the steps to reduce locally the size but it has not synced in the cloud. I need a cleanup on a repos and any help is welcome, thanks.


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

G'day.

As requested, I have triggered Git GC on all three repositories, and the size has been reduced. So can you check and verify with me if these are the correct repositories you wish to trigger the GC?

Cheers,  
Syahrul

comments: author: MCSAEP
body: Great! Yes, those same three repository. All fixed now, thank you so much!


Tags: bitbucket-cloud

cloud
Unable to push the local branch to remote origin
Asked by Delwar Hossain:

while running the following command

git push --set-upstream origin \<my-new-branch\>

then I am getting the following error:

fatal: \<my-new-branch\> cannot be resolved to branch

fatal: the remote end hung up unexpectedly


Answers:
author: Patrik S
body: Hello [@Delwar Hossain](/t5/user/viewprofilepage/user-id/3538736) ,

Thank you for reaching out to Atlassian Community.\\!

The error you reported usually happens when git is not able to find the branch you are trying to push. This is most likely caused by case sensitivity.

Could you try executing the following command in your local repository, which will list all the branches?

```
git branch -a
```

Then you can look for the branch you were trying to push and make sure you are using the exact same branch name returned by the command when providing the branch name for your git push.

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

Thank you, [@Delwar Hossain](/t5/user/viewprofilepage/user-id/3538736) .

Kind regards,

Patrik S


author: Sadiqur Rahman
body: [https://stackoverflow.com/questions/38034866/cant-push-to-remote-branch-cannot-be-resolved-to-branch?page=1\&tab=scoredesc#tab-top](https://stackoverflow.com/questions/38034866/cant-push-to-remote-branch-cannot-be-resolved-to-branch?page=1&tab=scoredesc#tab-top)


Tags: bitbucket-cloud

cloud
Git LFS push results in "batch request: Unauthorized: exit status 1"
Asked by Kostya Sydoruk:

Greetings,

I've forked one of my repositories and I now want fork it's LFS as well.

Following this guide:

<https://support.atlassian.com/bitbucket-cloud/docs/current-limitations-for-git-lfs-with-bitbucket/#CurrentlimitationsforGitLFSwithBitbucket-fork>

I've got to the point of

```
git lfs push --all origin
```

And I got

batch request: Unauthorized: exit status 1

I've tried adding an SSH key, I've made sure that I have read, write and even admin permissions. all to no avail.  
Steps to reproduce:

Create a repo, install LFS, track a file using LFS, Fork the repo and follow above guide.


Answers:
author: Patrik S
body: Hello [@Kostya Sydoruk](/t5/user/viewprofilepage/user-id/5100399) ,

Welcome to Atlassian Community!

I tried to reproduce the error you reported and the LFS push was completed successfully, so let me share the steps I've followed with you :

**1.** Clone the main repository in my local

**2.** Fetch all LFS history
>
> ```
> git lfs fetch --all origin
> ```
>
> At this point, your local clone should have all the LFS files downloaded

**3.** Inside the local clone, add a remote that points to the forked repository :
> If using **SSH** :
>
> ```
> git remote add fork-origin git@bitbucket.org:<fork's workspace>/<fork repository>.git
> ```
>
> Make sure the SSH key being used is associated with a user that has **write** access to the forked repository.
>
> If using **HTTPS** :
>
> ```
> git remote add fork-origin https://BITBUCKET_USERNAME@bitbucket.org/<fork's workspace>/<fork repo>.git
> ```
>
> When using HTTPS, if asked for a password, make sure to provide an [App Password](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/) with the required permissions. If you are still getting an Unauthorized error, you can create an App Password with all permissions checked and try again.

**4.** Push the LFS files to the forked repo using the origin you set in Step 3 :
>
> ```
> git lfs push --all fork-origin
> ```

You can try following the steps above and let us know how it goes.

Thank you, [@Kostya Sydoruk](/t5/user/viewprofilepage/user-id/5100399) .

Patrik S


Tags: bitbucket-cloud

cloud
Is it possible to use kubectl with oidc conn to opreate eks in bitbucket pipeline
Asked by Jiajia Long:

i 'd like to run 'kubectl apply -f xx.yaml' or some other kubectl commands in pipeline , but don't want to config $aws_access_id , $aws_access_key in pipeline. is it possible to realize?I have successfully configured oidc with ecr auth follow this:

<https://support.atlassian.com/bitbucket-cloud/docs/deploy-on-aws-using-bitbucket-pipelines-openid-connect/#Using-claims-in-ID-tokens-to-limit-access-to-the-IAM-role-in-AWS>

and pipeline works now.


Answers:
author: Aron Gombas _Midori_
body: Bitbucket pipelines has a concept of variables and **secrets**!

You can use it to store the AWS credentials in 2 separate secrets and have the pipeline yml refer to those. We do this with great success.

See: <https://support.atlassian.com/bitbucket-cloud/docs/variables-and-secrets/>


Tags: bitbucket-cloud

cloud
Can I select the version of php in composer:2 image
Asked by joseph:

In my project I want to deploy my Laravel application with composer and php v8.1.6, but the default of this container now is 8.2.0 as of Dec 12.  

I'd like to know if its possible to choose a version of php in this image? I have seen solutions that require me to host my own docker container, but obviously if I can avoid this and just specify in my pipeline what version of php I want that would be preferred.   

I have also seen the solution to use the --ignore-platform-reqs flag, which works, but i do not want to rely on this solution.  

For more context, my application will not deploy with v8.2 as i have dependencies that requires \<8.2, and i have tried to use the php:8.1.6-cli image, but this means composer is not properly installed and the build fails.  

This is my config, which fails at composer install step  

```
pipelines:
    branches:
        master:
           - step:
               name: 'Build and Test production'
               image: composer:2
               caches: 
                 - composer
               script:
                  - apt-get update && apt-get install -y libfreetype6-dev libjpeg62-turbo-dev libpng-dev
                  - curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer
                  - composer install
                  .....

```


Answers:
author: pshryock
body: Pin to **composer:2.4.1**


Tags: cloud

composer

laravel

php
Someone has already added that SSH key.
Asked by Zhou Mo:

Hi, I want to add a new ssh key in my personal account as I have switched to a new device. However, it prompts this error "Someone has already added that SSH key." when adding, but I don't think the key was added before in any projects. Could you please advise the solution?


Answers:
author: Theodora Boudale
body: Hi [@Zhou Mo](/t5/user/viewprofilepage/user-id/5100979) and welcome to the community.

I would suggest checking the following places:

**++Account SSH keys++**

Check the keys listed in <https://bitbucket.org/account/settings/ssh-keys/>, in case this key is already added to your account's SSH keys. You can select the pencil icon that edits each key, in order to view each key's value.

**++Workspace SSH keys++**

I can see that you are an administrator of another workspace (apart from your personal one) that has SSH keys associated with it.

Go to this page <https://bitbucket.org/account/workspaces/> to see all your workspaces listed, and select **Manage** for this other workspace \> select **SSH keys**, and then check the SSH keys listed there.

Please feel free to let me know how it goes.

Kind regards,  
Theodora

comments: author: Zhou Mo
body: Thank you! I managed to find the key in Workspace.


author: Theodora Boudale
body: That's good to hear and you are very welcome!

Please feel free to reach out if you ever need anything else.


Tags: bitbucket-cloud

cloud
Webhook for Oauth consumer revoke event
Asked by Evelin Szabados:

**Is it possible to receive a webhook event/get notified somehow about the revoke of my Oauth consumer?**   

I would like to know if a Bitbucket user that once granted access to my consumer revokes the access on Bitbucket UI. I browsed all related documentation but I could not find any answers on the topic.


Answers:
author: Dan Fraser
body: Hi [@Evelin Szabados](/t5/user/viewprofilepage/user-id/5100513),

Welcome to the Atlassian Community and thanks for your question. As you've worked out, there is currently no webhook, or other mechanism, to be notified of the revocation of an OAuth consumer.

I'd suggest raising an issue (of type ***Suggestion*** ) under the public **BCLOUD** project here: <https://jira.atlassian.com>. This allows other people to also **vote** for the issue and that helps us assess priority of new features etc.

Sorry I couldn't give a more useful response.

[@Dan Fraser](/t5/user/viewprofilepage/user-id/4470731)

comments: author: Evelin Szabados
body: Thank you very much


author: Theodora Boudale
body: Hi [@Evelin Szabados](/t5/user/viewprofilepage/user-id/5100513),

I created a feature request for what you asked in our public issue tracker:

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

Please make sure to add your vote (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.

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
Clearcase to bitbucket Migration
Asked by Dnyaneshwar Borase:

Hi team,

We are planning to do ClearCase to bitbucket Migration in our migration. So can you please guide us how we can procced and follow the steps?

I have gone through various document, but I haven't got proper step which we need to follow for this migration

Your guidance is really appriciated.

Regards,

Dnyaneshwar


Answers:
author: Patrik S
body: Hello, [@Dnyaneshwar Borase](/t5/user/viewprofilepage/user-id/4766162)

Welcome to Atlassian Community!

Since ClearCases is a different version control system, you will need to first migrate from Clear Case to Git.

Once you have your ClearCase migrated to git repositories, you can then push these repositories to your Bitbucket Cloud workspace.

I found the following links that might help you in the first step of migrating from ClearCase to Git

* [How to migrate ClearCase to git with history](https://community.atlassian.com/t5/Answers-Developer-Questions/How-to-migrate-clearcase-to-GIT-with-history/qaq-p/556047)
* [ClearCase to Git](https://therub.org/2013/07/19/clearcase-to-git/)
* [ClearCase to Git migration](https://stackoverflow.com/questions/26967817/clearcase-to-git-migration)

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

Thank you, [@Dnyaneshwar Borase](/t5/user/viewprofilepage/user-id/4766162) .

Patrik S

comments: author: Dnyaneshwar Borase
body: Hi [Patrik S](https://community.atlassian.com/t5/user/viewprofilepage/user-id/4603309)

Thanks for the reply.

I gone through shared links but not getting clear steps which, we need to follow for the migration.

I would like to know exact steps for migrating Clear case latest VOB in Git

Your help will be highly appreciated.

Regards,

Dnyaneshwar


author: Patrik S
body: Hello [@Dnyaneshwar Borase](/t5/user/viewprofilepage/user-id/4766162) ,

I'm afraid we currently don't have specific Atlassian documentation related to migrating from ClearCase to Git, as ClearCase is a proprietary format.

Also, it doesn't seem to exist a tool to fully migrate from ClearCase to Git.

From what I could find on the internet, the migration from ClearCase to Git is not that straightforward, so I'm not sure you will find an exact step-by-step guide.

I would suggest checking the articles I previously shared and understanding how they would apply to your use case. I also found this one that might be of help :

* [Git - ClearCase](https://github.com/charleso/git-cc)

Thank you, [@Dnyaneshwar Borase](/t5/user/viewprofilepage/user-id/4766162) .

Kind regards,

Patrik S


Tags: bitbucket-cloud

bitbucket-data-center

bitbucket-server

cloud
SourceTree not working in windows 10
Asked by riturajshukla:

I installed SourceTree and cloned the files into my local system. Everything was working fine but suddenly I got this error when trying to open SourceTree yesterday.

![sourcetree error.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/18409i2D6F20461D354078/image-size/large?v=v2&px=999 "sourcetree error.JPG")


Answers:
author: Mike Corsaro
body: Hello! Everything should work fine if you click the first option.

comments: author: riturajshukla
body: It worked. Thanks a ton.


author: Steffen Bode
body: Hi,

for me: not solved!

I use win pro 10 64 bit and at first, an older sourcetree version from january 2017, wouldn start, after a "strange" update prozess (2.4.8.0) without any messages, sourcetree doesnt work.

at my dev notebook, works an older version from december 2017 already.

so here is an exceptionlog:

Application: SourceTree.exe  
Framework Version: v4.0.30319  
Description: The process was terminated due to an unhandled exception.  
Exception Info: System.Runtime.InteropServices.COMException  
at System.Management.ThreadDispatch.Start()  
at System.Management.ManagementScope.Initialize()  
at System.Management.ManagementObjectSearcher.Initialize()  
at System.Management.ManagementObjectSearcher.Get()  
at SourceTree.Utils.WindowsOSHelper.GetWindowsVersion()  
at SourceTree.App..ctor()  
at SourceTree.App.Main()

Cheers

Steve


author: Mike Corsaro
body: Sounds like the WMI service has a problem. Could you try the steps [listed in this post](https://community.atlassian.com/t5/Sourcetree-questions/Re-Re-SourceTree-has-stopped-working/qaq-p/593008/comment-id/14880#M14880)? Thanks.


author: Steffen Bode
body: jep, ok, this wmi service was deactivated. hmm, its a strange dependency for a software. a .net framework is not enough?


Tags: windows
How do I disable previews?
Asked by Elyes_Gherib:

Previews slow the GUI down and they're not always needed. Is there a way to hide them?

Many thanks.


Answers:
author: Mike Corsaro
body: Hello! I'll need a bit more details to help you. What operation system are you using, and could you be more specific about which previews you're referring to? Thanks!

comments: author: Elyes_Gherib
body: Hello Mike,

I am using Mac OS X v10.12.6 and Source Tree v2.7.1 (159).

Below is a picture of the previews that I mentioned. When there is a small number of files, it is fast, but when there are many hundreds, it freezes for many minutes.

![Capture d?e?cran 2018-04-14 a? 17.57.48.png](https://community.atlassian.com/t5/image/serverpage/image-id/19619iC3C321997F3BE000/image-size/large?v=v2&px=999 "Capture d?e?cran 2018-04-14 a? 17.57.48.png")

Many thanks.


author: Elyes_Gherib
body: Mike ?


Tags: mac
Push to gerrit with sourcetree
Asked by dbellerose:

Hello,

I want to push commit to gerrit with sourcetree.

I read a previous answer edited in 2014 about this topic, but it seems that nobody found solution to solve the problem.

I have the last version of sourcetree, is it possible to do this now?

Best regards,


Answers:
author: Ana Retamal
body: Hi David! You can use SourceTree to push and pull with *any* valid git remote. However Gerrit tends to use an extended push syntax / settings to be specific about what changes are for review - if you need to specify those on demand you would be better to push from the command line, but if you can define them as a static rule in your .git/config then SourceTree will respect that (see the section about editing .git/config here <http://gerrit.googlecode.com/svn/documentation/2.0/user-upload.html>).

I also found some threads with more info about this, you can read them [here](https://stackoverflow.com/questions/9917645/push-to-gerrit-using-sourcetree) and [here](https://community.atlassian.com/t5/Sourcetree-questions/Configuring-Sourcetree-Push-for-Gerrit/qaq-p/110655).

Hope that helps!

Ana

comments: author: dbellerose
body: Hello Ana,

Unfortunately, i already test those thread but they are not working.

From command line the push to gerrit is working.

When i put the value :

push = refs/heads/\*:refs/for/\* in the section remote origin in the git config file, the

push action create a branch and don't make a push to gerrit.

I don't understand why.

Best regards,


author: Michael Zhou
body: Under the "remote branch" column on push dialog, type "refs/for/\<your_feature_branch\>" or "refs/for/master" depending upon which branch you want to push to.


author: expect_pin
body: It's work! Thanks


author: Husam Aldalaq
body: This is not related to Gerrit but I'm running into an issue with Sourcetree and custom fetch/push Refspec set in .git/config. I've been digging for a while and this is the closest comment I've seen to my issue.

If I set my QA team with their environment to only track QA subdirectory branches i.e

\[remote "origin"\] url = git@github.com:org/repo.git

fetch = +refs/heads/qa/\*:refs/remotes/origin/qa/\*

push = refs/heads/\*:refs/heads/qa/\*

fetch is respected and Sourcetree would only show the qa/ subdirectory.

checkout of a remote branch (doesn't exist locally) Sourcetree would default to using qa/branch-name instead of branch-name (given the remote branch name as origin/qa/branch-name)

push works ONLY if the branch already existed in remote, so pushing changes to the branch. However, with a new branch (not published to remote) if I click on Push, the local branch would not be listed in the list of branches that could be pushed.

Generally with the terminal or most other GUIs I've used, when the refspec is set in .git/config, all interaction would default to those Refspecs, with Sourcetree that doesn't seem to be the case. I'm wondering if there's something I'm missing.


Tags: gerrit
Sourcetree github workflow - coming from tortoise svn
Asked by Chris Curra:

Good afternoon,

we have a game team of over 10 with programmers, artists, animators, level designers and all different types using unreal engine 4 to make a game.

We are use to the tortoise svn workflow and are now realizing git is much different especially in regards to "merge".

we are having issues especially with "merge" where people are doing a commit/push and if there is or isn't a conflict it seems to do these "merges" and overrigt, or wipeout files or work that other team members have done and we don't know why.

we are assuming that sourcetree was made for code only and can easily merge text but when it comes to multi asset (binary files) and code at the same time in a big team we are having a lot of issues losing work.

lastly we are all working in one master branch. I've been told that we may need one more "working" branch before we go to master or each member on the team need their own branch and then when happy merges their changes on their own into master.

There is also this "rebase" function instead of merge and a. I don't know how to turn this on and b. if this will fix our issues or create more?

basically tortoise svn works great but we have a github account and I really want to use it. so if someone can tell me a workflow with sourcetree/git that works like tortoise svn where we won't lose files I'd be greatly appreciated.

Christopher


Answers:
author: bgannin
body: Hi Chris,

There are a few things you've mentioned that need to be separated out...

* Git - equivalent to SVN in some ways, is a version control system (VCS)
* Sourcetree - equivalent to TortoiseSVN in some ways, is a VCS client
* GitHub - a service that you typically "host" a repository on

Git is fundamentally different in how it functions versus SVN; there is no central server per se and it just happens to be that you've chosen GitHub as your team's remote backup for coordinating work (versus Bitbucket Cloud or others.) I would recommend spending some time with our [Git tutorials](https://www.atlassian.com/git) to learn the ropes. HTH.

Brian Ganninger  
Senior Mac Developer, Sourcetree


Tags: branch

github

merge

rebase

tortoise