youngmon/atlassian-qna huggingface dataset:
How do i get the file content by passing commit version number?
Asked by Shruthi R:

May i get a bitbucket API to copy the file content by passing the commit version number?


Answers:
author: Patrik S
body: Hello [@Shruthi R](/t5/user/viewprofilepage/user-id/4665563) ,

Welcome to Atlassian Community!

The Bitbucket API provides the following endpoint to get the contents of a single file, or the contents of a directory at a specified revision (commit) :

```
GET /2.0/repositories/{workspace}/{repo_slug}/src/{commit}/{path}
```

* When `path` points to a file, this endpoint returns the raw contents.
* When `path` points to a directory instead of a file, the response is a paginated list of directory and file objects

That being said, and example request to that endpoint would like like the following :

```
curl --request GET --user <BitbucketUsername>:<AppPassword> --url https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/src/{commit}/{path}
```

For more information about this and other endpoints available on the Bitbucket API, you can refer to the following documentation:

* <https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source/#api-repositories-workspace-repo-slug-src-commit-path-get>
* <https://developer.atlassian.com/cloud/bitbucket/rest/intro/>

Hope that helps to address your question. Let us know if you need further assistance :)

Best regards,

Patrik S


Tags: bitbucket-cloud

cloud
BB Runner I am facing The connection observed an error and runner status it's shown unregistered
Asked by Rajkumar:

In Command Line run the BB Runner Token it shows the Updating runner state to "ONLINE".  
After we getting this error, BB Runner I am facing The connection observed an error and runner status it's shown unregistered.<https://bitbucket.org/rajkumar-dev/runner-demo-repo/admin/addon/admin/pipelines/runners> ![BB runner error.PNG](/t5/image/serverpage/image-id/172794i5C70910F4803AA17/image-size/large?v=v2&px=999 "BB runner error.PNG")


Answers:
author: Patrik S
body: Hello [@Rajkumar](/t5/user/viewprofilepage/user-id/4665288) ,

Welcome to Atlassian Community!

We had an incident on December 7th related with a downstream outage in our underlying platform provider AWS that affected the Bitbucket pipeline builds, as you can see in our public status page :

* <https://bitbucket.status.atlassian.com/incidents/k6pbf7mbxhdd>

The issue you reported seems to be related to that incident, so would you please try to run your runner container again and let us know if you face the same error ? If yes, then we can troubleshoot further.

Thank you, [@Rajkumar](/t5/user/viewprofilepage/user-id/4665288) :)

Best regards,

Patrik S

comments: author: Rajkumar
body: Hi [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) ,

I am tried bitbucket runner container but facing same issue, Please fix that error, PFA SS.

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

<https://bitbucket.org/rajkumar-dev/workspace/settings/addon/admin/pipelines/account-runners>

Regards,

Rajkumar T.


author: Patrik S
body: Hello [@Rajkumar](/t5/user/viewprofilepage/user-id/4652524) ,

Thank you for trying again and sharing the results.

In this case, looking at the error message being thrown on the console, it looks like the runner is not being able to connect to the Bitbucket API. Just to give you a background, when a runner is started, it creates a long living websocket connection to listen for Pipelines events. Also, once self-hosted Runners is done executing specific commands/actions, Runners will then update Pipelines through Bitbucket REST API.

That being said, to confirm your firewall is not blocking the requests to Bitbucket API, could you please make sure all the IPs below are in the allowlist of your firewall ?

* <https://ip-ranges.atlassian.com/>

Let me know how it goes, and if you have any other questions.

Thanks [@Rajkumar](/t5/user/viewprofilepage/user-id/4652524)

Kinds regards,

Patrik S


Tags: bitbucket-cloud

bitbucket-runners

cloud
New SourceTree version 1.9.x too slow
Asked by ronpeled:

This new version of sourcetree is painfully slow. I keep going into command line whenever the working folder view 'hangs' for no reason. In some cases only 2-3 files changed and it is way too slow. I'm not sure what is it trying to do differently but your previous version was so much faster. Please help!

At this point it seems I may even need to go back and restore one of your older versions. This is too painful.


Answers:
author: ronpeled
body: Sure, issue created: <https://jira.atlassian.com/browse/SRCTREE-2407>


author: Seth
body: Please note that the terms "you" and "your" on this website are generally being read by other users, not Atlassian employees. If you have any specifics on the issue, you can post a bug report at [jira.atlassian.com](http://jira.atlassian.com), or if you need help resolving an isolated problem, open an issue at [support.atlassian.com](http://support.atlassian.com).


Tags: git

performance
Source Tree and Jenkins
Asked by Farhad Bheekoo:

Hi

Is there a way to insert hooks for Jenkins through sourcetree?

Regards

Farhad


Answers:
author: Farhad Bheekoo
body: It sits in the 'hgrc' file which sits in '.hg/' folder. I just wanted to know if there was an easier way of adding hooks through the client. Currently everytime I clone a new repo, I have to go into the file and input the jenkins hooks.just wanted a nice 'Click here' put in the jenkins link and save :). Is there?


author: Timothy
body: Hooks sit in the repository right? And not in the repository client?
Not able to push repo using Sourcetree 'cannot spawn: ...\TortoisePlink.exe'
Asked by M S:

Dear Community,

I want to push a repo to a gitlab repo.

Sourcetree (Windows 7) returns following error message:

```
error: cannot spawn C:\Program Files\TortoiseGit\bin\TortoisePlink.exe: No such file or directoryfatal: unable to fork
```

I don't have TortoiseGit installed and use OpenSSH as SSH-Client.

Do I have to install TortoiseGit next to Sourcetree?

Thanks in advance :)

Kind Regards,

Michael


Answers:
author: M S
body: Oh yeah, there is a variable 'GIT_SSH' set.

This was the fix.

It should point to the normal git binary (e.g. C:\\Program Files (x86)\\Git\\bin\\git.exe) instead of TortoiseGit binary.

Thanks!


author: M S
body: Thanks for the fast reply!

I cloned this repo from another git instance and want push it to a bare gitlab repo.

Yes, I had TortoiseGit installed a few months ago.

May there some env variable set?


author: Seth
body: Have you ever had TortoiseGit installed?

Did you copy this repository from another computer (instead of cloning from a remote)?

Even if you install TortoiseGit, you'll have problems: "Programm Files" should only have one "m".
Japanese characters in comment turns into '?' when squashing interactively
Asked by Miura Takuma:

SourceTree for Windows 1.5.2

default charset = utf8

In the interactive rebase schedule dialog, when I squashed commits with Japanese message, squashed message becomes like "????????????".

Even I rewrite the message, the generated commit still holds a message like "??????????".

Non-ASCII characters seems not dealed with appropriately.


Answers:
author: Miura Takuma
body: Thank you Henrique, I should have shared the issue.


author: HenriqueA
body: Hi Miura,  

I've checked that you've already opened a bug report into **[jira.atlassian.com](http://jira.atlassian.com)** , I want to share here the answer from SourceTree developer that can be useful for other users that are facing the same issue:  

> If the input was via SourceTree then it should definitely be in UTF-8. If you did it via the terminal then you have the option to tell Git (via a config setting) what encoding you're using. If this isn't specified then it defaults to UTF-8. Are you committing from the terminal?
>
> Also, would it be possible to provide us with some output so we could see what encoding the commit content is in? Either you could provide the repository, or alternatively you can call "git cat-file commit \<hash\>" using the hash of the commit that's showing the question marks, then paste the output in here.

More details can be found on this report:

* [](https://jira.atlassian.com/browse/SRCTREEWIN-1751)<https://jira.atlassian.com/browse/SRCTREEWIN-1751>

<br />

Kind Regards,  
Henrique


Tags: language-ja
Freezes when adding subtree from repository that requires authentication
Asked by Miura Takuma:

SourceTree for Windows 1.5.2

I have a sub repository that requires authentication.

When I add this repository as a subtree, push, or pull, the dialog stops after it says
> git -c diff.mnemonicprefix=false -c core.quotepath=false subtree push -P (my subdirectory) http://(mysub repository).git master
>
> git push using: http://(mysub repository).git master

It seems like git.exe is asking my username and password.

How can I do with this?


Answers:
author: krisrok
body: using ssh instead of https solved this for me

comments: author: Miura Takuma
body: kris, that's a goot solution.
mulitple working directories
Asked by mallikarjun ithagoni:

hi all, can we create multiple directories in Source Tree.

ex: i have working directory W1 cloned and i was working on it. whatever changes i do here will be updated.before i raise codereview and i want to create new working direcotory W2 and i want to work on it. changes done to W2 should affect W1 and vice-versa.

is it possible in Source Tree ?

please help me........... thanks in advance.........


Answers:
author: Seth
body: SourceTree definitely does NOT provide a way to do what you want the way you describe. As far as I have seen, Git does not support it (I expect Mercurial doesn't either), so SourceTree can't.

A partial solution (can be done with SourceTree), is as follows:

Let's say W1 is the working copy of R1 (local repository 1). You can use SourceTree (or any other Git client) to clone R1 to a new local location (R2). Both R1 and R2 are local, and you can push and pull between them. You can also set up R2 with the same remote(s) as R1. If you are just working on SourceTree and you want to push an R2 change *through* R1 to the remote, you'll actually have to checkout that branch in R1, push it, then switch back to whatever branch R1 was on to begin with.
SourceTree comments in commit message (starting with '#')
Asked by Jonathan Wiens:

When using commit.template config (see [](/questions/143622/git-config-commit-template-apparently-not-working)<https://answers.atlassian.com/questions/143622/git-config-commit-template-apparently-not-working>) SourceTree reads the template file just fine. When committing, it doesn't ignore lines starting with '#' though, as it was designed by git.

In the terminal, when committing with a message that contains lines starting with a '#', git ignores those lines and does not make them part of the actual commit message. SourceTree on the other hand makes them part of the actual commit message.

Is this behaviour wanted? If yes, why?

I want commit message templates that explain where what goes, specifying keywords that dynamically interact with a project management platform (Redmine, [](http://www.redmine.org/projects/redmine/wiki/RedmineSettings#Referencing-issues-in-commit-messages)<http://www.redmine.org/projects/redmine/wiki/RedmineSettings#Referencing-issues-in-commit-messages>) as comments that should be ignored in the actual commit message.

I'm currently working with SourceTree 1.5.2.0 on Windows 8 and system Git version 1.9.0

Thanks!


Answers:
author: Henrik Johansson
body: It is possible to configure the commit cleanup mode.

If you configure "commit.cleanup" to "strip", SourceTree will behave more as you would like ( "as it was designed by git" :smile: )

git config --add commit.cleanup strip

comments: author: Jonathan Wiens
body: Perfect! Thanks


author: Johan Kaving
body: And the reason can be found in the documentation for the commit.cleanup option:
> **strip**
>
> Strip leading and trailing empty lines, trailing whitespace, commentary and collapse consecutive empty lines.
>
> **whitespace**
>
> Same as `strip` except #commentary is not removed.

...
> **default**
>
> Same as `strip` if the message is to be edited. Otherwise `whitespace`.

The crucial part is "is to be edited" in the description of the default setting.

When committing from the command line and letting Git open an editor the mode used will be "strip". But if you supply the commit message using "-m" or "-F" the "whitespace" mode will be used.

By looking at "Show Full Output" when committing from SourceTree you can see that the commit message is saved to a temporary file and supplied to Git using the "-F" option.


author: Reto Ryter
body: Same problem here.

Mac OSX Yosemite, SourceTree: Version 2.0.5.2 (2.0.5.2)

System Git version 2.3.0


Tags: comment

commit

git-ignore

message
After source crashed, I can not login my MAC.
Asked by Gomsama:

First time, I was changed my git password.

And sourcetree, pops up git password was wrong.

I just enter new password, but source tree has been crashed.

I think it just crush...

But next time, chrome crashed with no reson.

So I reboot MAC.

But I can not login my account.

I just entered correct password, progress circle goes, and few second later, MAC just request password for me.

(And I entered worong password, I can see animation means wrong password.)

please help me T_t.


Answers:
author: Seth
body: It sounds like you changed the password for access to a remote repository. If you can't log in to that account in your browser, you probably should contact the host. Where are you hosting your repository? (Bitbucket, GitHub, Stash,...?)
are added subtrees transferable inbetween workstations?
Asked by Shallow Thought:

Is it possible to make added/linked subtrees show up in Sourcetree on other workstations?


Answers:
author: Shallow Thought
body: Created feature request:

<https://jira.atlassian.com/browse/SRCTREE-2456>


author: Azizur Rahman
body: It would be good if the subtree meta (.git/sourcetreeconfig) data can be made part of the .gitmodules that way it can be shared with remote repositories.

comments: author: Seth
body: I don't know much about subtrees, but sounds like a good feature request. If so, post it to [jira.atlassian.com](http://jira.atlassian.com)and put a link here.


author: Shallow Thought
body: I'm not familiar about how Sourcetree handles saving its data under the hood and did not understand your answer. Could you please clarify? As far as I can see, there is no "subtree meta data" within .git/sourcetreeconfig. Also, I did not uderstand the correlation between .gitmodules and subtrees.


Tags: subtree
how does sourcetree save my password?
Asked by p:

Hello I like to know when saving my username and password if it is encrypted by the program.

I am asking this because TortoiseHg only saves it in a text file


Answers:
author: p
body: For anyone else who is looking for an answer to this question here is the response of Atlassian:

*I can confirm that the password you choose is encrypted not stored in a flat file or text file.*


author: Seth
body: Good question. The mac version uses the OSX keychain. On Windows, it uses something internal.

Try contacting [](http://support.atlassian.com)[support.atlassian.com](http://support.atlassian.com) for information.


author: p
body: Bump


author: p
body: I am using Windows 7


author: Seth
body: Please indicate whether you are using Windows or Mac.
SourceTree: Multiple BitBucket accounts
Asked by dracan:

In SourceTree for Windows, I have multiple Bitbucket accounts created (actually just 2). They both have different passwords. SourceTree seems to get confused by this, and constantly prompt me for passwords even though I've saved them. I don't have this issue if I only have one Bitbucket account associated.


Answers:
author: Derek Visch
body: I seem to have this issue right now as well, multiple users on a windows machine accessing source tree we get asked for different users credentials for sourcetree.


author: KieranA
body: Hey Dan,

There's a bug which has been fixed for the next minor release (in 2 weeks\~ time) that occurs in certain scenarios. This causes HTTPS auth details to not be remembered correctly if it's the very first time, but only for some users. To fix this, you can open the keychain application and add it manually by putting in 'bitbucket.org' and your username, then specifying the password. This way, SourceTree can then use the keychain to go and get those auth details and you won't be prompted again.

1.9.3 will fix this, however. Very sorry about that, fortunately there's a workaround for this case.

Cheers

comments: author: dracan
body: Hi Kieran,

Thanks for the very quick reply :) Sorry, I forgot to mention that I'm using the Windows version. I'm not sure what a keychain application is, but a quick Google suggests that it's a Mac thing. Is there something similar I can do to resolve it in the Windows version?

Thanks again,  
Dan


author: Seth
body: Kieran's issue is regarding a very similar issue for the Mac version. I don't think the version or fix that he is referring to will have any relevance to us Windows users.


author: KieranA
body: You're right, Seth. Windows works completely different, and that doesn't have any bugs in authentication.

@DanI can only suggest that you haven't loaded your keys, perhaps? Are you using Pageant?


author: dracan
body: I'm using SourceTree's inbuilt 'Hosted Repositories', which has 'HTTPS' as the preferred protocol - so I presume this just uses the username/password for authentication and doesn't involve keys?


author: dracan
body: I've just tried changing one of the Bitbucket accounts to use SSH instead of HTTPS, and this seems to have got around the issue. There does seem to be a bug in the Windows version with multiple Bitbuckets accounts that are using HTTPS authentiation though.


Tags: windows
Sourcetree freezes Windows
Asked by Stanislav Neuberger:

Hello,

my Sourcetree installation freezes Windows or produces Bluescreen everytime it is open parallel to Visual Studio 2013. I could not find the trigger for the freeze yet as it sometimes happens after a minute of "coworking" and somtimes after 10. Any idea about the cause?

Thx


Answers:
author: ArtyomE
body: Maybe you using Denwer?  
Because i am using and also have that problems.  
The program always stuck and freeze...

Also i am using asus laptop N53S with Windows 7 - Service Pack 1 64 Bit


author: Thorsten Klein
body: Hi Stanislav,

have you figured out anything about it?

I have nearly the same setup, using a German version of Windows 7 Enterprise as well.

I don't use Visual Studio, but SSMS a lot having the same effect of freezing my notebook...

Thx


author: Stanislav Neuberger
body: 1. System Git 1.8.4 (crashes also using embeded Git)
2. Intel Core i7 3630 2.4 GHz CPU / 8 GB RAM / 167 GB SSD - 71 GB Available
3. Repository is located on the local drive (HDD)
4. One repository in source tree
5. One repository window is open
6. Sourcetree version 1.5.2.0
7. Windows 7 Enterprise Service Pack 1 64 Bit
8. No file filters are used
9. No untracked files
10. Repository is not corrupt (git status and any other operation is working fine)
11. Last log file entries

2014-05-20T09:06:45: Error loading image: [http://www.gravatar.com/avatar/b335a9a41081dd78034ae915c6935337?s=80\&d=identicon:](http://www.gravatar.com/avatar/b335a9a41081dd78034ae915c6935337?s=80&d=identicon:)System.NotSupportedException: Es wurde keine passende Imagingkomponente zum Abschlie?en dieses Vorgangs gefunden.  
System.Runtime.InteropServices.COMException: Ausnahme von HRESULT: 0x88982F50  

2014-05-20T09:16:55: Error loading image: [http://www.gravatar.com/avatar/b335a9a41081dd78034ae915c6935337?s=80\&d=identicon:](http://www.gravatar.com/avatar/b335a9a41081dd78034ae915c6935337?s=80&d=identicon:)System.NotSupportedException: Es wurde keine passende Imagingkomponente zum Abschlie?en dieses Vorgangs gefunden.  
System.Runtime.InteropServices.COMException: Ausnahme von HRESULT: 0x88982F50  

2014-05-20T09:16:55: Error loading image: [http://www.gravatar.com/avatar/b335a9a41081dd78034ae915c6935337?s=80\&d=identicon:](http://www.gravatar.com/avatar/b335a9a41081dd78034ae915c6935337?s=80&d=identicon:)System.NotSupportedException: Es wurde keine passende Imagingkomponente zum Abschlie?en dieses Vorgangs gefunden.  
System.Runtime.InteropServices.COMException: Ausnahme von HRESULT: 0x88982F50


author: HenriqueA
body: Hi Stanislav,  

There are some useful information that you can provide here to a better troubleshooting.  

It's possible to check it on the Atlassian Knowlodge Base page:

* <https://confluence.atlassian.com/display/SOURCETREEKB/Troubleshooting+Performance+Problems+in+SourceTree>

<br />

Could you please provide these information?  

Kind Regards,  
Henrique Lechner


Tags: visual-studio
What exactly "Commit merged changes immediately" does?
Asked by Philip Steinebrunner:

Hi

I'am new to SourceTree/Git. Can anyone explain what exactly "Commit merged changes immediately" while pulling does? What is the difference between checking and unchecking this option?

Cheers Philip


Answers:
author: BenjiI
body: Hi Philip,

You have to do a commit when a merge is completed, because some of your local files might also be updated. By enabling the *Commit merged changes immediately* you give sourcetree the permission to do this commit directly/automatically if there were no merge conflicts.

Hope this answers your question?!

comments: author: BenjiI
body: If this option was enabled and the merge fails with merge conflicts, no automatic commit will take place (and you have to do it manually after the merge conflicts have been fixed).


author: Davel Liu
body: What is the difference with \`git fetch\` if I leave the checkbox unchecked.

git pull equal to git fetch and then merge, right ?


author: Seth
body: "git fetch" only updates the background copies of the remote branches. None of your local branches are updated.

If you pull or merge from a tracked remote branch WITHOUT committing immediately, then it will place the merge result into your working copy as "uncommitted changes".


author: Davel Liu
body: Got it. Thanks a lot.


author: wouter_visee
body: \> because some of your local files might also be updated

I feel like I'm missing something here, isn't that the whole point of a pull, to update your local files? And why can't you update your local files by making a new commit?


author: Ashrith Racharla
body: You are right in saying the purpose of Pull is to update local files. However, checking the "Commit merged changes immediately" helps you to avoid a few clicks/commands by doing both Pull and Commit at one go.

The response might be too late for you, but still wanted to comment as it might help somebody else!


Tags: git