youngmon/atlassian-qna huggingface dataset:
git reset broke my local repo, how to change to (initial) commit?
Asked by JR_Atlassian:

Ok, so I have "read the documentation" down before I go making changes so while resetting my master I somehow deleted all the files that I managed to fix after three years... but following this link.

<https://community.atlassian.com/t5/Sourcetree-questions/Undo-quot-Reset-current-branch-to-this-commit-quot/qaq-p/340956>

I found the 'git reset --hard HEAD@{1}' worked and I have my files back WHEW.

So now I am getting an error

"""

On branch master

Your branch and 'origin/master' have diverged,

and have 1 and 1 different commits each, respectively.

(use "git pull" to merge the remote branch into yours)

nothing to commit, working tree clean

"""

When I do a git pull I get

'fatal: refusing to merge unrelated histories'

My git reflog produces this.

"""

133f131 (**HEAD -\>****master**) HEAD@{0}: reset: moving to HEAD@{1}

310786e (**origin/master**) HEAD@{1}: reset: moving to origin/master

133f131 (**HEAD -\>****master**) HEAD@{2}: commit (initial): Elisabeth is working

"""

How do I make sure I save the files I have, then I guess merge them into the repo and finally what "learn git" course would you recommend?


Answers:
author: Theodora Boudale
body: Hello,

If you have all the files you need locally, you can run **git status** in your local repo, to see if the changes in these files have been committed or not. If you see in the output **nothing to commit**, then the changes have been committed, otherwise you can commit any changes you have made so that you don't lose them.

You can take a backup of your local repo by copying the directory of the repo to a different location. If you want to take a backup of your remote repo, before making any changes, you can take a clone with the mirror flag:

```
git clone --mirror repo_url
```

The message that you get on pull, '**fatal: refusing to merge unrelated histories**', indicates that the local repo and the remote one have unrelated histories and they don't have any common commits. If you still want to pull and merge them, you can run

```
git pull origin master --allow-unrelated-histories
```

However, I strongly recommend taking a backup of both repos before you do that, as I suggested above.

We have the following tutorials on Git, which start with the basics and then move to more advances topics:

* <https://www.atlassian.com/git>

If you have any questions or need any further help, please feel free to let me know!

Kind regards,  
Theodora


Tags: bitbucket-cloud

cloud
How to setup a bitbucket pipeline to build code once and manually deploy to multiple environments?
Asked by Alfred Gonzalez:

Trying to build a BitBucket pipeline file to only build once and then push that build to different environments manually. but right now as i see it builds in each step and pushes. How do i use the image from the previous step.

    pipelines:  custom:    buildDeploy:      - step:          name: Build Keycloak Docker Image and Upload Dev          services:            - docker          deployment: dev          script:            - ls -ahl            - docker build -t keycloak .            - pipe: atlassian/aws-ecr-push-image:1.2.0              variables:                IMAGE_NAME: keycloak                TAGS: 'latest'      - step:          name: Build Keycloak Docker Image and Upload Demo          services:            - docker          deployment: demo          trigger: manual          script:            - ls -ahl            - docker build -t keycloak .            - pipe: atlassian/aws-ecr-push-image:1.2.0              variables:                IMAGE_NAME: keycloak                TAGS: 'latest'      - step:          name: Build Keycloak Docker Image and Upload Prod          services:            - docker          deployment: Prod          trigger: manual          script:            - ls -ahl            - docker build -t keycloak .            - pipe: atlassian/aws-ecr-push-image:1.2.0              variables:                IMAGE_NAME: keycloak                TAGS: 'latest'options:  docker: true


Answers:
author: ktomk
body: > How do i use the image from the previous step. \[?\]

Via the registry.

The underlying problem you most likely run into with the design how you deploy the images is that you make use of the \`latest\` tag which is prone to side-effects that are that harsh that you can't (with your current setup/design) deploy the same (container image build) revision first to dev, then test and then prod.

But I might misread your pipeline to some extend, as I can't see how the deployment to different environments there work already. If the image push to aws ecr is the deployment already then I can't see how this are actually different environments (here: dev, test and prod).

Maybe you can add a bit more context if your problem is more with creating the images, more with pushing them or more with deploying them to the different dev, test and prod environments and give a bit more description.


Tags: bitbucket-pipelines
How to do bit bucket setup. I wanted to.do this for UAT SEVER of my project
Asked by Sweta thakur:

Uat server having different directory and sub directory having code inside it


Answers:
author: Nic Brough -Adaptavist-
body: Start at <https://confluence.atlassian.com/bitbucketserver/get-started-with-bitbucket-server-872139857.html>


Tags: bitbucket-server

server
How do you import a private git repository?
Asked by ekennedy80:

I have a private git repository on my PC and want to import this repo into bitbucket. Is there an easy way to do this?


Answers:
author: Mikael Sandberg
body: Hi [@ekennedy80](/t5/user/viewprofilepage/user-id/4108873),

Welcome to Atlassian Community!

To import a local repository this is what you need to do:

1. Create a new repository in Bitbucket if you have not done so yet.
2. Get the new URL for the repository by clicking Clone and copy the URL
3. In your local repository, set the new remote URL by running this command:  

       git remote add origin <repository URL>

4. Push everything back to Bitbucket by running this command:  

       git push -u origin master

comments: author: Aaron_Ridout
body: When I try to push I get the following - I assume its because the bitbucket repo is not as empty as we'd like? - it has a README.md and .gitignore which I dont want/need? how do I force the push to overwrite the nearly empty bitbucket?

*** ** * ** ***

! \[rejected\] master -\> master (non-fast-forward)  
error: failed to push some refs to '<https://bitbucket.org/advenergy/im_dc_lit_g703_103_gnd_fw.git>'  
hint: Updates were rejected because the tip of your current branch is behind  
hint: its remote counterpart. Integrate the remote changes (e.g.  
hint: 'git pull ...') before pushing again.  
hint: See the 'Note about fast-forwards' in 'git push --help' for details.


Tags: bitbucket-cloud

cloud
Why don't you want our money???
Asked by Mihai Moldovan:

CA-1101335 Purchasing and Licensing Request: Renewal quote  

Hello,

A month ago, we requested (as a reseller) a renewal quote for Bitbucket Server, for one of our clients. We received a quote with a sales tax applied. I asked the advocate that was assigned to this particular case (Eli) for another quote, without a sales tax applied, since we already purchased this product since 2017, without a sales tax applied.

He asked for further documentation, tax exemption certificates, that I uploaded on CertCapture. It came back as being invalid, a few times. I asked Eli why the certificate is invalid, and what can we do to solve the issue, to correct whatever was wrong on the certificate. From September 11th, I received no answer from Eli. On the 30th of September I called you Amsterdam office, where the person who answered my call was kind enough to shoot a personal email to Eli, asking him to respond to my emails. He did respond on the 30th, telling me what was wrong, and asking me to re-upload the certificate. I did that, and the certificate is still pending. Since then I've sent two more emails to Eli, and no answer so far. I want this issue solved **++TODAY++**!.

So, my question to you is, why don't you want our $12k? We want to pay you, and you seem uninterested in our money. I will send this message everywhere I can, until you manage to solve a simple issue.

Thank you in advance for taking care of this issue!


Answers:
author: Daniel Eads
body: Hello Milhai, welcome to the Community!

I wanted to acknowledge that multiple Atlassians took action from this Community post today, as well as the other support avenues you asked for help through. Reviewing the case information, I believe everything is in order now with the updated quote that has the correct tax information. Thanks for your patience on this!

If you need any more assistance with billing and licensing items in the future, the purchasing and licensing request process you've already gone through is indeed the best way to get help. Due to the sensitive nature of billing requests, we're not able to help with those requests directly here on Community - which is completely public. But we're happy to answer other questions, provide technical guidance, and talk about best-practices here! I hope to see you around the Community!

Cheers,  
Daniel \| Atlassian Community Support


Tags: bitbucket-server

server
Is it possible, using YAML anchors, to define variables that you pass to the script
Asked by Etienne Noel:

I want to us YAML anchors but in the script of my anchor, I need to pass a variable of the version that I push to NPM. Is there a way to pass or define a variable that will be used in the YAML anchor?

Here's what I'm trying to achieve

```
definitions:
  steps:
    - step: &build
        name: build
        script: 
          - npm version $VERSION_NUMBER

pipelines:
  branches:
    master:
      - step: *build
        VERSION_NUMBER = 1.0.0 # I don't know how to do this
  default:
    - step: *build
      VERSION_NUMBER = $BITBUCKET_BUILD_NUMBER-$BITBUCKET_BRANCH?# I don't know how to do this
```


Answers:
author: Halyna Berezovska
body: [@Etienne Noel](/t5/user/viewprofilepage/user-id/1254544) variables are not shared through artifacts, but you can put this string to text file and user VERSION_NUMBER: $(cat version.txt)

Regards, Galyna


Tags: bitbucket-pipelines
How to get variable uuid?
Asked by Mohamad Abuzaid:

I can't get the repository variables uuid...  
How to get it?


Answers:
author: Mohamad Abuzaid
body: Found it :)...  

**First**: in order to get the uuid of your repository variables you can call this:

```
curl --user "$USER_NAME":"$PASSWORD" 'https://api.bitbucket.org/2.0/repositories/{username}/{repo_slug}/pipelines_config/variables/' -H 'Content-Type: application/json'
```

where:  
- USER_NAME -\> your user name from your profile

- PASSWORD -\> You can create an App Password from [here](https://support.atlassian.com/bitbucket-cloud/docs/app-passwords/ "App Password") to avoid using your own password

- username \& repo_slug -\> from your repository url

\* This will return all your variables with their uuid  

**Second:** Pick the uuid you want and use this to update it value:  

```
curl -vX PUT -u "$USER_NAME":"$PASSWORD" --url 'https://api.bitbucket.org/2.0/repositories/{username}/{repo_slug}/pipelines_config/variables/%7Bvariable_uuid%7D' -H 'Content-Type:application/json' -d "{\"value\":\"{new_value}\", \"key\":\"{variable_name}\"}"
```

**Note:** Keep the %7B \& %7D in the 'variable_uuid' section in the url, as they will be decoded to { \& } which are required for the request to work


author: Nic Brough -Adaptavist-
body: It's in the settings, but I'm wondering why you want it. Of what use is it?

comments: author: Mohamad Abuzaid
body: Can't see it.... I want to update the variable from api call using curl


author: Nic Brough -Adaptavist-
body: You don't need the uuid to use curl against a repository.

Could you explain what you're really trying to do?


author: Mohamad Abuzaid
body: I created a repository variable for my workspace pipeline, and I want to update this variable using a script in one of the pipeline steps. But in order to change a repository variable I need to know its uuid first


Tags: bitbucket-cloud

cloud
Where do I find the checked out repo in the docker instance
Asked by u.trautenberg:

We need to setup a custom docker image to build our repository (cross toolchain for arm targets).  
Where in the docker instance is the mount point for accessing the repos current branch?

And is there a way to pass git credentials to the docker instance, since some git operations are run within the build script.


Answers:
author: ktomk
body: Hi [@u.trautenberg](/t5/user/viewprofilepage/user-id/4109690) welcome to the Atlassian Community.
> Where in the docker instance is the mount point for accessing the repos current branch?

The path as an environment variable $BITBUCKET_CLONE DIR ([docs](https://confluence.atlassian.com/bitbucket/environment-variables-794502608.html#Environmentvariables-Defaultvariables))

Also the working directory when the pipeline step script starts.
> \[Is\] there a way to pass git credentials to the docker instance \[?\]

This should work out of the box for your bitbucket repositories. If you have a more dedicated case, there should be more specific Q\&A material already. Just comment / ask about concrete problems with that if you still have (it's good to have one topic per question).


Tags: bitbucket-pipelines
How to find total Number of Space & Pages ,attachments on Confluence cloud site ?
Asked by Shubham Burghate:

Hi Community members,

Would like to know how we can collect the Confluence cloud statistics for Number of spaces, pages, attachments ?

Thanks \& Regards,

Shubham Burghate


Answers:
author: Alex Koxaras _Relational_
body: Hi [@Shubham Burghate](/t5/user/viewprofilepage/user-id/4413758)

Since you are on a free plan, best thing to do is to install an app (even for trial) [from the marketplace](https://marketplace.atlassian.com/search?hosting=cloud&product=confluence&query=statistics) and collect the data you need. There isn't any other way out of the box, as far as I know.

comments: author: Shubham Burghate
body: Hi [@Alex Koxaras _Relational_](/t5/user/viewprofilepage/user-id/4150197)

Thanks for your response, just to inform not on free plan.

And do you have any idea which apps are available for this ?


author: Alex Koxaras _Relational_
body: Use the link above to navigate to the marketplace. But to name a few:

* [https://marketplace.atlassian.com/apps/1224662/usage-statistics-for-confluence?hosting=cloud\&tab=overview](https://marketplace.atlassian.com/apps/1224662/usage-statistics-for-confluence?hosting=cloud&tab=overview)
* [https://marketplace.atlassian.com/apps/1224099/advanced-spaces-content-statistics?hosting=cloud\&tab=overview](https://marketplace.atlassian.com/apps/1224099/advanced-spaces-content-statistics?hosting=cloud&tab=overview)
* [https://marketplace.atlassian.com/apps/1229447/site-statistics-for-confluence-cloud?hosting=cloud\&tab=overview](https://marketplace.atlassian.com/apps/1229447/site-statistics-for-confluence-cloud?hosting=cloud&tab=overview)


Tags: cloud

confluence-cloud
Is it possible to establish some components of a global template & leave others open to modification
Asked by Eleni Vordos:

Hi everyone,

I want to create global tempaltes and establish some components within them, so that users can not change the flow of the page. E.g.

* Project Title
* Logo
* Team ..ect.

Is it possible to set some headings, so that they can't be moved around or delated, but also allowing some sections to be flexible so that users can add their content?

Thank you in advance!


Answers:
author: Alex Koxaras _Relational_
body: Hi [@Eleni Vordos](/t5/user/viewprofilepage/user-id/5122617)

Out of the box you can't do that unfortunately. There isn't such a functionality. Once a page is created and a user has edit permissions, then he/she can edit anything.

comments: author: Eleni Vordos
body: Thank you Alex!


author: Alex Koxaras _Relational_
body: [@Eleni Vordos](/t5/user/viewprofilepage/user-id/5122617) kindly mark my answer as accepted in order to help others with similar questions. Thank you!


Tags: cloud

confluence-cloud
Adjust Card Size on Confluence Dashboard
Asked by beans_421:

![Picture1.png](https://community.atlassian.com/t5/image/serverpage/image-id/234969iA45183B0D7EFFC61/image-size/large?v=v2&px=999 "Picture1.png")![Picture2.png](https://community.atlassian.com/t5/image/serverpage/image-id/234968iC521002B439A679A/image-size/large?v=v2&px=999 "Picture2.png")![Picture3.png](https://community.atlassian.com/t5/image/serverpage/image-id/234967i95EB98E3E38971BB/image-size/large?v=v2&px=999 "Picture3.png")The two boxes in the first photo (Achievements and What Did We Do) were brought in by using JQL/Card/Excerpt (as shown in the second photo). I want to adjust the width of these two boxes to make them align with other content on the page. I tried to use the CSS style in the Card Macro, but it didn't work somehow. How can I adjust width/length of a card?


Answers:
author: Brant Schroeder
body: [@beans_421](/t5/user/viewprofilepage/user-id/5114615) Which card app are you using from the marketplace? Have you submitted a support request to the app creator?


Tags: cloud

confluence-cloud
When sharing a page link, is it possible to limit which sections of the page a guest can view?
Asked by Eleni Vordos:

Hi everyone,

We want to share some page links with potential clientes, but there are some informations that are rather conflidential. Is it possible to restrict visibility to only a segment of the page, or should I just create another page without the sensitive information on it?

Thank you in advance! :)


Answers:
author: Mahesh Shinde
body: Hi [@Eleni Vordos](/t5/user/viewprofilepage/user-id/5122617) ,

Natively there is no way to hide some text in a page, but you can use Page Properties macro , which can help to some extent. add details and check the hidden so that content of the macro would not be visible unless you go to edit mode.

This helps to a certain extent but not fully.

If you are open for a paid third party app, you can explore app like [Comala Document Management](https://marketplace.atlassian.com/apps/142/comala-document-management?tab=overview&hosting=cloud) through which you can setup review/approval and publishing workflow for your documents.

Regards,

Mahesh Shinde

comments: author: Eleni Vordos
body: Thank you [@Mahesh Shinde](/t5/user/viewprofilepage/user-id/2230848)


author: Nino Stana
body: Hi [@Mahesh Shinde](/t5/user/viewprofilepage/user-id/2230848), thanks for recommending [Comala Document Management](https://marketplace.atlassian.com/apps/142/comala-document-management?tab=overview&hosting=cloud)

Hello [@Eleni Vordos](/t5/user/viewprofilepage/user-id/5122617) , we might be able to solve your requirement. It would be helpful if you could open a ticket with us at [**Support Comalatech**](https://support.comalatech.com/) with more details on how your content is structured.

Best Regards,  
Nino


Tags: cloud

restriction
How to create a page w/tabs, each tab a different topic with separate attachments - 1 per tab?
Asked by Travis N:

I'm trying to streamline access to the page so for example:

On my automotive page there is a vehicle tab with detailed pictures (as attachments) for each vehicle we own. The next tab is the repair history tab with repair invoices for each car (as attachments), and the last tab is the modifications tab holding a roadmap (again as attachments) for each vehicle. So, three tabs, different subjects, the attachments match the subjects.

I've tried fitting the attachment macro in tab macro without any luck.

Thanks in advance!


Answers:
author: Rodrigo
body: Hello [@Travis N](/t5/user/viewprofilepage/user-id/5124004), and welcome to the Atlassian Community.

Unfortunately, Confluence does not have any native Tab management apps integrated, but this is something you can achieve by using third-party apps.

Our team develops Navitabs for Confluence, which enables users to create Tab Navigations quickly and easily.

For your particular case, we could suggest trying the Childtabs macro, which generates a Tab Navigation based on all the existing Child Pages, so you would not need to make any significant changes; just place the macro on the parent page, and that's it! (and the attachments will remain on their respective pages)

I'll share some links below:

* [Navitabs - Tabs for Confluence](https://marketplace.atlassian.com/apps/28632/navitabs-tabs-for-confluence?tab=overview&hosting=server)
  * [Navitabs Documentation - Childtabs macro](https://bitvoodoo-apps.atlassian.net/wiki/spaces/BVNAVITABS/pages/5269062100/Childtabs+Macro)

We hope this might be helpful for your objectives!

With friendly regards  
Rodrigo


author: Nic Brough -Adaptavist-
body: Welcome to the Atlassian Community!

There's no way to do this natively, and I don't think you can do it at all

You can install apps that provide tabs in Confluence, but they are part of a page, and the container for attachments is the page. You can put links and views of different attachments on different tabs, but all the attachments are on the same page.

You can also install apps that break up, or at least sort or group attachments (see [https://marketplace.atlassian.com/search?product=confluence\&query=attachment](https://marketplace.atlassian.com/search?product=confluence&query=attachment)) so you could do "group by tab", but even then, it is not quite what you are looking for.

Combining a tabs app with a "order attachments on page" app is probably the closest you can get here.


Tags: confluence-server

server
Permissions
Asked by Marie Capitan:

Permissions and inherited permissions are confusing on Confluence. I need help determining who has access, how to grant access, and restrict access for a site that I created for our Department.


Answers:
author: Nic Brough -Adaptavist-
body: I'm old and have been here for a long, long, long time, so I do not find them confusing. I will try not to bore you too much, but it is very complex nowadays.

A user can log into Confluence

* The space permissions say they can see things
* The space permissions say they can do other things
* Pages within those spaces may stop them seeing pages, and/or editing them
* If the space is set up as a "knowledge base" then Jira customers can also (sort of) view it, without any other permissions. And they don't need a Confluence login either.
* There is an "anonymous" option - never give that anything other than "read pages"
* Atlassian introduced "guest" accounts a while ago - single space, can do whatever your space admins allow

I'm sticking with "it is complex". But start at the top of the list I gave.


Tags: confluence-server

server
I saved a draft and it is no longer available. Can I find a version of that draft anywhere?
Asked by courtney.kunzig:

I wrote up a new confluence page, saved as a draft, it appears someone else edited the page and published and not all of my changes were saved or appeared. Can I find that original draft anywhere?


Answers:
author: vikram
body: Hi [@courtney.kunzig](/t5/user/viewprofilepage/user-id/5123929) welcome to Atlassian Community

One way is logout and login then it will show the recent space,

second :- Click on confluence menu then it displays your profile page, on this screen lick on Recent Menu.

Third:- Click on Spaces all spaces,

Fourth:- Click on Recently Updated at the end of confluence screen.

if the above do not work then you can request Atlassian Support if the page information is important.

Vikram P


Tags: cloud

confluence-cloud