youngmon/atlassian-qna huggingface dataset:
desperately searching where I can configure http access tokens.
Asked by EppIctUnit:

Hello, following the tutorial here, I can't find what I need:

<https://confluence.atlassian.com/bitbucketserver/personal-access-tokens-939515499.html>

1. Go to **Profile picture** \> **Manage account** \> **HTTP access tokens**.
2. Select **Create token.**

Here is what I have:

![Capture.PNG](/t5/image/serverpage/image-id/170828iD972067037544E05/image-size/large?v=v2&px=999 "Capture.PNG")

Nothing also in personal settings:

![Capture2.PNG](/t5/image/serverpage/image-id/170829i67AB1798D1E96C1C/image-size/large?v=v2&px=999 "Capture2.PNG")

Did it move somewhere else ?

In my atlassian settings, nothing here also.

I want to create an access token to clone, trough https, one of my repo's.

Thanks !


Answers:
author: seanaty
body: The link you reference is for Bitbucket **Server** but the screenshot you shared is from Bitbucket Cloud.

To clone through HTTPS Bitbucket Cloud recommends what's called an "app password" (because it can also be used to make requests to the Bitbucket API).

You can see the link to "App passwords" in your screenshot. Create one there.

comments: author: EppIctUnit
body: Thank you !

I created an app password, gave read acces on repos etc.

But when I try to:

git clone <https://x-token-auth:3B9ByAAAAAAAAAAAAAA8Y7@bitbucket.org/XXXXXXXXX/XXX_PROJECT.git>  
Cloning into 'XXX_PROJECT.git'...  
fatal: Authentication failed for '<https://x-token-auth:3B9ByAAAAAAAAAAAAAA8Y7@bitbucket.org/XXXXXXXXX/XXX_PROJECT.git>'


author: seanaty
body: You don't want to use x-token-auth with app passwords. Replace that with your username. Also, if that's your real app password you should delete it and create a new one.

<https://support.atlassian.com/bitbucket-cloud/docs/clone-a-repository/>


author: EppIctUnit
body: ok, thanks again for your help, Indeed, that way it works.

The idea was to allow to clone trough https with composer without sharing a login :-/

We want to pull code from our many repos with composer

The problem is that this composer is shared between developers etc. so it's not clean to use user / token even if it's read only.

It look like also that's not possible to restrict to some repos, it gives access to all the repos.

note: we cannot use SSH.

I though that the only solution was this one:

X-token-auth seems to be attached to repos and not to accounts.

<https://stackoverflow.com/questions/24965307/how-to-manipulate-bitbucket-repository-with-token/43114159#43114159>

<br />

*We recently introduced OAuth 2 and also added the ability to use them as HTTP Basic Auth credentials.*

*Cloning a repository with an access token*   
*Since add-ons will not be able to upload their own SSH keys to clone with, access tokens can be used as Basic HTTP Auth credentials to clone securely over HTTPS.*

```
git clone https://x-token-auth:{access_token}@bitbucket.org/user/repo.git
```

<br />

The literal string x-token-auth as a substitute for username is required.


Tags: bitbucket-cloud

cloud
How to un-spam a task? If I accidentally "Make as spam" it.
Asked by Timmy Nguyen:

I don't know how to un-spam a task. When I accidentally "Make as spam" the task. (I can see the task on issues list, but when click on the title to see details. I got 410 notification.)![spam2.png](https://community.atlassian.com/t5/image/serverpage/image-id/170820iDE6ED1AC01FDE9EF/image-size/large?v=v2&px=999 "spam2.png")

I have try to find any solutions. But I didn't get any answer.  
Very bad!  
Can anyone help me answer it?  
Thanks.

![make_spam.png](/t5/image/serverpage/image-id/170819iA597D359EBD598EF/image-size/large?v=v2&px=999 "make_spam.png")


Answers:
author: Syahrul
body: Hi [@T Wind](/t5/user/viewprofilepage/user-id/4648167)

Welcome to the community!

If I got this right you mistakenly mark an issue as spam and are no longer able to access the issue in Bitbucket?

If yes, I believe you will need to reach out to your repositories administrator to **Approve** the issue so it's marked as not spam. Only the Workspace or repositories admin is allowed to unmark the issue key.

Ask the admin to navigate to repositories issue \> open the issue that was marked as spam and click the drop-down menu \> Select **Approve** to unmark the issue as spam.

I hope this helps.

Cheers,  
Syahrul


Tags: spam

task
error while using user data reporting api for bitbucket
Asked by Pankaj Patil:

I am trying to build user data reporting API for bitbucket by following below documentation:  

<https://developer.atlassian.com/cloud/bitbucket/user-privacy-developer-guide/#report-accounts-api>

But I am getting the below error for my request:  

\`{  
"tid": "1bdd6d248d58a2ad",  
"code": 401,  
"type": "APIError",  
"message": "Unauthorized Issuer micros-group/bitbucket is not whitelisted "  
}\`  

I am trying this for a private app. Is there something that I am missing in the request?  

Thanks


Answers:
author: Norbert C
body: Hi Pankaj,

Thank you for contacting Atlassian Support, I'm Norbert from Bitbucket Cloud Support, it's nice to meet you! Welcome to the Atlassian Community :)

I would like to inform you that unfortunately this question is unsupported on the "regular" Atlassian Community, but can I ask you to ask this question at the Developer Atlassian Community page?

You can ask the same question on the following site, where our developers will answer this question: <https://community.developer.atlassian.com/>

Have a great day ahead!

Best Regards,  
Norbert  
Atlassian Bitbucket Cloud Support


Tags: bitbucket-cloud

cloud
I want create a deployement for my laravel 8 application with hostgator hosting
Asked by Sushant Gudalkar:

Hello All,

I am new here, I don't have proper knowledge of how to start this.

I have code on the bit bucket repository but I want as soon as someone commits to merge with the master, The code should be deployed on the Hostgator server.

Can someone help me how should I start this?


Answers:
author: Igor Stoyanov
body: [@Sushant Gudalkar](/t5/user/viewprofilepage/user-id/4648747) hi. Thanks for your question.

You could look at this [php deploy template](https://bitbucket.org/bitbucketpipelines/template-php-gae-deploy/src/master/bitbucket-pipelines.yml), but replace last step \`  
atlassian/google-app-engine-deploy:1.0.0\` with any of rsync-deploy, ftp-deploy, sftp-deploy.  
To discover these pipes and other visit our [**Bitbucket Pipes Marketplace**](https://bitbucket.org/product/features/pipelines/integrations).  
Regards, Igor


Tags: bitbucket-pipelines
Recreate/reinstall elasticsearch in AWS image
Asked by Oliver Smith:

I've been running a BB Server in AWS for a while, and I'd experimented with offloading the elastic search to a different host, but after a while I realized the utilization was ridiculously low.  

I re-enabled search in the server image and followed directions for reindexing:  
[Rebuild the Elasticsearch indexes for Bitbucket Server \| Bitbucket Data Center and Server \| Atlassian Documentation](https://confluence.atlassian.com/bitbucketserverkb/resolve-elasticsearch-404-error-by-rebuilding-the-index-833988382.html)  
[Reindex a specific repository for Code Search \| Bitbucket Data Center and Server \| Atlassian Documentation](https://confluence.atlassian.com/bitbucketserverkb/reindex-a-specific-repository-for-code-search-1044806359.html)  

despite following both sets of instructions a couple of times and restarting the entire server, it just looks like it isn't bootstrapping the elastic search data:  

\`\`\`  

# Identify the repo id  
bituser@bitbucket$ more shared/data/repositories/1/repository-config  
#\>\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
# THIS FILE IS MAINTAINED BY ATLASSIAN BITBUCKET  
# IT CONTAINS NO USER-SERVICEABLE PARTS.  
#\>\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\[bitbucket\]  
hierarchy = 4f96aade7422dcded681

\`\`\`

and trying  

\`\`\`

$ curl -u bitbucket -X GET <http://localhost:7992/bitbucket-index-state/indexstate/1>

{"_index":"bitbucket-index-state","_type":"indexstate","_id":"1","found":false}

\`\`\`

and likewise for all the other repositories.

How can I trigger a re-bootstrap and rebuild of the elastic search index locally in this image?


Answers:
author: Christian Glockner
body: Hi Oliver,

Go take a look at <https://confluence.atlassian.com/bitbucketserverkb/bitbucket-server-code-search-is-unable-to-find-results-from-some-or-all-repositories-858783145.html> and see if the instructions there help you get your repos reindexed.

Cheers,

Christian

Premier Support Engineer

Atlassian


Tags: bitbucket-server

elastic-search

server
REST API to create and delete branch
Asked by Asipu Pawankumar:

Please help me with the APIs to

* Create Branch
* Delete Branch


Answers:
author: Caroline R
body: Hi, [@Asipu Pawankumar](/t5/user/viewprofilepage/user-id/4647843)! Welcome to the community!

You can run the following request to **create a branch** using API:

```
curl https://api.bitbucket.org/2.0/repositories/{workspace}/{repository}/refs/branches 
-s -u username:AppPassword -X POST -H "Content-Type: application/json" 
-d '{
"name" : "{new_branch_name}",
"target" : {
"hash" : "main"
}
}'
```

"main" should be the existing branch or commit hash from where you want to create a new branch.

And in order to **delete a branch**, you can run the following request:

```
curl --request DELETE -u username:AppPassword https://api.bitbucket.org/2.0/repositories/{workspace}/{repository}/refs/branches/{branch_name}
```

You can access the following links to find these endpoints:

* Create a branch:

  * <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-branches-post>

  * <https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/refs/branches#post>

* Delete a branch:

  * <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-branches-name-delete>

  * [https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/{workspace}/{repo_slug}/refs/branches/{name}](https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D/%7Brepo_slug%7D/refs/branches/%7Bname%7D)

I hope this helps, but do let me know if you have any questions.

Kind regards,  
Caroline

comments: author: Asipu Pawankumar
body: .


author: Kube Net
body: Hi,

What Kind of option needs to be used for creating and deleting branches?


author: Alex Xu
body: non cloud , local host bitbucket , how do we create branch ? and merge to master ?


Tags: bitbucket-cloud

cloud
SourceTree messes up the commitname of the Submodule in use
Asked by JIRA Autobot:

Hi,

I am playing around with SourceTree and submodules and i have added a submodule then at some point i changed the Submodule to a Tag named Test. The Submodule name in the tree reflects this on the parent repo, that's fine. Now i checkout to master to get back to master but the name in the tree still says Test but now with a commit added (which is master) but the name is wrong. It should not state Test anymore since i am not looking at the Tag. Best would be stating master and the commit.

This must be a bug.

donnib


Answers:
author: Seth
body: Can you post a screenshot of what you mean? It's a little hard to follow.
Powershell scripts do not show changes in window
Asked by mantzas:

![](../../../upfiles/2014-04-03_17_40_58-SourceTree.jpg)Hi,

I have a modified powershell script.

Although it show on working copy changes windows, it show nothing in the diff window when i select it!

Any suggestions?

Regards,

S. Mantziaris


Answers:
author: Alan Warren
body: If you're using PowerGUI use the File-\>Encoding menu to choose UTF-8. PowerGUI's default encoding doesn't seem to work nicely in Git.

comments: author: mantzas
body: Hi Alan,

changing the encoding had this result:

Before: ![](../../upfiles/Unicode.jpg)

After: ![](../../upfiles/UTF-8.jpg)

Any suggestions? (TortoiseGit has no issue diffing the file)


author: Alan Warren
body: I'm sorry to hear that didn't work for you; I was feeling quite positive after I got it working on my system.

Is it possible you've modified your .gitattributes trying to fix this? A line like \*.ps1 -text might be problematic (I'm no expert).

My .gitattributes contains:

\*.ps1diff  
\*.ps1text

When I made the encoding change, I had to do a "garbage commit" -- my term for when a commit doesn't involve semantic change, but rather changes imposed by a tool. My diff looked like this:

![My Diff After PowerGUI Encoding Change](http://www.awarren.ca/images_for_external/sourcetree_powergui_encoding.png)

The beginning of the diff also contains some funky characters, which I believe are referred to as the BOM by Unicode enthusiasts.

HTH,  
Alan


author: mantzas
body: this did the trick.

many thanks.


author: mantzas
body: no, the changes are significant.

is there a git config issue or is it sourcetree?


author: Seth
body: Are the changes whitespace only?
SourceTree wants me to Register. How do I register for SourceTree?
Asked by Brian Silverman:

Periodically, when I bring up SourcTree, it tells me how many days I have left, and reminds me about registering. I thought I did that already. When I check my account, I even have a SEN# for SourceTree. What am I missing and how do I remedy this? Great product, I don't want to lose it.


Answers:
author: KieranA
body: Just to add to this, you don't even need to do that. There's [my.atlassian.com](http://my.atlassian.com)integration built right into SourceTree. You can log in to your account from SourceTree and it'll auto-import your license for you.

This is in SourceTree \> Registration \> Register. We should probably call it 'Register / Login' because it actually lets you login to your acount.


author: Brian Silverman
body: I found the answer among the pages of questions asked earlier, thanks for the helpful log (don't know how I missed it in my earlier search). Basically, for anyone interested, I just needed to go to my account and download my license from there to my machine. Then from my MacOS ... SourceTree-\>Registration-\>Import license and direct it to the downloaded license file and I receive the successful/thanks for registering. Thanks again for your patience, all is well again.
Stop tracking marks file for deletion
Asked by jmejiaa1986:

I want to stop tracking a file so I can then ignore it. When I do stop tracking, it puts it in my index with a RED circle for deletion.. reading online it seems it should be putting a question mark instead, I'm afraid it'll delete the file.

What am I doing wrong?


Answers:
author: alex
body: Sorry to necro an old thread but the SourceTree behavior seems a little inconsistent (there's probably a reason, but I don't know why). For one file I clicked "Stop Tracking" and it turned to a question mark, then I clicked "Ignore." Worked fine, submitted .gitignore.

Next two files, I clicked "Stop Tracking" and they turned into red Xs. I committed those, THEN the same files appeared with question marks... then I could ignore them. Checked .gitignore, looked correct, submitted.

I don't know why the behavior was different, but... it seems sometimes you can "Stop Tracking, Ignore" other times you have to "Stop Tracking, Commit, Ignore."


author: Seth
body: It's just a matter of misunderstanding the command. For some reason Atlassian appears to have made the decision to disable ignoring tracked files via the UI. "Stop tracking" is a different, but still important, feature.

I expect ignoring files like this is a rare occurance. You'll just have to rely on the command line, I think.


author: jmejiaa1986
body: Well, isn't that what gitignore command is(Which worked in the command line)

It allows me to ignore the changes I make locally, but keep the file in the repo. For example I'm using this to hard code my ID and PW in a form, but obviously I don't want to check it in to git.. So this way this login file is ignored...

I was able to do it in the command line, just curious why it's not working with sourcetree.


author: Seth
body: I'm not sure exactly what you are looking for, but what you describe will delete the file from the repository, but not from your working copy. In other words, the file will still be in the directory you are modifying, but if someone was to clone your repository, they wouldn't have the file at all.

I don't know of any way to ignore a file in your working copy that exists in the repository.
Pulling from remote (GitHub) to server
Asked by benomatis:

I have SSH access to my server and am cloning / pulling from a GitHub repository fine via command line, but I was wondering if there was a way for me to do all this via SourceTree (Version 1.7.4.1 (1.7.4.1) / OSX 10.9.2).

Cloning to a local repo, then adding my server as another remote would probably be the easiest (and I know how to do that), however I would like to be able to control when and what gets to this server, hence I'd rather use the copy on the server as a local repository pulling from the GitHub repository.

Is there a way to achieve this in SourceTree?

Thanks!


Answers:
author: Seth
body: You might be able to acheive what you want by mounting your server's repo locally, but people have had a lot of trouble using SourceTree (or any other Git client) to treat network storage as a local repository ([here](/questions/77637/local-mac-using-network-home-server-as-git-repo-possible), for example.

I would recommend using SourceTree to clone from GitHub locally, add your server as a remote, and push changes from your local instance to the server.

You would still have to use SSH access to keep the server's working copy up to date (git merge to pull changes out of the server's repo into working copy, or git checkout to switch branches).

comments: author: benomatis
body: So the jist of your answer is that it's not possible (or very difficult). Like I said, I know how to add another remote to SourceTree but that would basically push anything to both remotes (GitHub \& the server) at the same time, correct? Can these 2 (GH and server) co-exist at all as remotes of the same repo?


author: Seth
body: You can almost certainly push to just one remote at a time or both, whichever you prefer for a given operation. Remember, Git was designed without any concept of a "central" repository. It is trivial to follow that kind of workflow using Git, but you can also have many remotes with the same repository and push/pull the same commits or different commits in any way you like.


author: benomatis
body: I'd have one more question: I managed to setup my server as 2nd remote, however it's not updating the files on the server. One detail I haven't shared: I also would like to use my server location as the output of my local copy so others can test my online app / website. How can that be done with SourceTree?


author: Seth
body: To my knowledge, you can't make any changes to a remote's working copy in SourceTree, and probably can't in any other client either. You're better off using an IDE that will automatically FTP changes to a server.

If you want to use Git, you'll need to SSH into the server and run a git merge periodically (which will merge the changes you've pushed to that remote into the remote's working copy).


author: benomatis
body: Thanks for your help!


Tags: github

server

ssh
Sourcetree without external repository
Asked by alexsosa:

Hi,

Is there a version of Sourcetree that allows sharing code among a developer group but doesn't require storing code in an external repository such as GitHub?

TIA,

Alex


Answers:
author: KieranA
body: Hey there,

SourceTree has no limitations like this, all it wants is a URL to the repository. Git is a distributed system - the repository can be stored anywhere. If you want repositories behind the firewall and have an interface to that you could consider using Stash or Gitolite.

In short the answer is yes - you could get something up and running for people to share code in a repository on your local network within mere minutes.

Cheers

comments: author: alexsosa
body: Thank you very much Kieran. I have another question but will ask it on a separate thread.


author: buff buff
body: Hi Kieran,

You mention that you can use sourcetree and gitolite but I cannot get this configuration to work. Source tree does not seem to recognise the gitolite server. I keep getting the error that indicates that it does not recognise my url as a path to a git server. If I bypass gitolite and I point straight to the repositories folder then it works. What could I be going wrong?


author: Seth
body: Try to connect to the gitolite server with the command line git client to see if you get a more specific error message. Off the top of my head, SourceTree may choke if you are using HTTPS with a self-signed certificate.


author: buff buff
body: I tried that and I get a similar response:

fatal: '/testing' does not appear to be a git repository  
fatal: Could not read from remote repository.

I am not using HTTPS. Should I be?

I have installed git and gitolite and am simply trying to clone one of the repositories that are created by the default gitolite setup. If I do this from the server it works. As soon as I try to use the same command from a remote windows machine I get the above error.

If I bypass gitolite and I go straight to the repositories folder it works but then that defeats the whole point of having gitolite.


author: Seth
body: If command line Git is giving you the same response, then the problem is either with how you have gitolite setup, or how you're trying to access. You'll probably have more luck if you pose your questionin a gitolite forum of some sort. Try to git it working via command line first, then if SourceTree still has issues, come back here.


author: buff buff
body: Thanks Seth. That saved me from annoying a lot of people. :-)My gitolite config was incorrect. I have now managed to get that working with the source tree command line.

The GUI still gives me the same error. Is there some trick to getting the GUI to identify the gitolite server?


author: buff buff
body: Aah... fixed that one too.

The problem was that Pageant was still using the old key. I just deleted that and manually inserted the correct one.

I think this is a bug because in the GUI I had already changed that key to my one. It does not seem to refresh the one being used by Pageant.
Trying to push to bitbucket.org (authenticate not accepting password)
Asked by Mateusz_Winiarski:

Greetings I'm trying to do push to [bitbucket.org](http://bitbucket.org)with SourceTree.

I've got my branch "shahmatt" in a project. I've checked out this branch to local PC. Did some changes. And now I want to push changes to bitbucket. And it keeps asking for my password (which is correct, I use it to login to my account on [bitbucket.org](http://bitbucket.org)).

Show Full Output says:

hg push --new-branch shahmatt

pushing to \<address\>

....

remote: permission denied to update branch default

remote: transaction abort!

...

I don't have access to default branch, but I want to push to shahmatt branch.

What am I doing wrong?

Thanks for help.


Answers:
author: Mateusz_Winiarski
body: I figured it out.

First, "When you checkout a branch, you should *already have a local clone* of the parent repository.", as it is said in Bitbucked documentation.

Then, after checking out a branch, making changes, and commiting, when you push you need to use advanced options (at a bottom of a push window) and write down branch to which you will push.

Then it asked about password, but accepted it, and push was done.

comments: author: Seth
body: Interesting. I wonder if that is bitbucket-specific or mercurial-specific. With Git, whenever I checkout a remote branch, it automatically sets the local branch to track the correct remote one.


Tags: bitbucket-cloud

cloud

windows