youngmon/atlassian-qna huggingface dataset:
Bitbucket Cloud SSH Host Keys replacement
Asked by aviklein:

Hi, I replaced my keys yesterday like explained in this blog post: <https://bitbucket.org/blog/ssh-host-key-changes>  

Even since, when I want to pull- I get this message:  

Offending key for IP in /home/master/.ssh/known_hosts:3  
Matching host key in /home/master/.ssh/known_hosts:7  

Then I need to approve the pull. Every time.  
How can I fix this (remove the offending key)?  

There is no explanation in the post.  

Thanks


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

The warning message you are receiving is likely related to old entries on your known_hosts file that are pointing to the bitbucket IP, instead of the domain name bitbucket.org.

To resolve this issue, you can remove the older entries and store the new ones using the following command :

```
ssh-keygen -R http://bitbucket.org/ && sed -i.old -e '/AAAAB3NzaC1yc2EAAAABIwAAAQEAubiN81eDcafrgMeLzaFPsw2kNvEcqTKl/d' ~/.ssh/known_hosts && curl https://bitbucket.org/site/ssh >> ~/.ssh/known_hosts
```

This is also covered in our [Bitbucket Cloud SSH rotation FAQ](https://confluence.atlassian.com/bbkb/bitbucket-cloud-ssh-host-key-rotation-faq-1235851234.html).

Thank you, [@aviklein](/t5/user/viewprofilepage/user-id/212674) !

Patrik S

comments: author: aviklein
body: Cool! Seems to work now.

Thank you!


author: jjl71
body: Hi, I got similar problem as OP but after running the command above, it results like this:

# Host bitbucket.org found: line 13 type RSA  
# Host bitbucket.org found: line 14 type ECDSA  
line 15 invalid key: bitbucket.org...  
# Host bitbucket.org found: line 16 type ECDSA  
line 17 too long: bitbucket.org ssh-ed25519 AAAAC3NzaC1lZD...  
/home/this_user/.ssh/known_hosts is not a valid known_hosts file.  
Not replacing existing known_hosts file because of errors

Would you happen to have a fix for this?


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

The error being returned indicates that your known_hosts files are in an invalid state, so SSH was not able to properly update it with the new bitbucket fingerprints.

In this case, I would suggest renaming the current known_hosts file to a different name, e.g. known_hosts_backup :

    mv /home/user/.ssh/known_hosts /home/user/.ssh/known_hosts_backup

and then execute the command again

```
ssh-keygen -R http://bitbucket.org/ && curl https://bitbucket.org/site/ssh >> ~/.ssh/known_hosts
```

so ssh will rebuild the known_hosts file from scratch.

Please note that if you have other entries in the original known_hosts files other than Bitbucket, you will need to manually copy those to the new fresh known_hosts file create when you execute the command above.

Thank you, [@jjl71](/t5/user/viewprofilepage/user-id/26653) !

Patrik S


Tags: bitbucket-cloud

cloud
Need to get the changed,added,removed files between two commits
Asked by yashodperera:

Currently, when configuring a webhook to trigger on a code push event in Bitbucket Cloud, the payload does not include information about the specific files that have changed. Does Bitbucket Cloud provide a dedicated API endpoint to directly retrieve the changed, added, or deleted files between two commits?   

I have done some search and identified the following endpoint which includes all the changes which is not scalable.   

<https://api.bitbucket.org/2.0/repositories/{workspace}/{repo}/diff/{commit1}..{commit2>}  


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

Thank you for reaching out to Atlassian Community!

I think what you are looking for can be achieved using the diff stat endpoint :

* [Compare two commits diff stat \| Bitbucket Cloud API](https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-diffstat-spec-get)

This endpoint should return a JSON object containing all the files that were added,removed,modified or renamed by comparing two commits.

Following is an example of an API call using that endpoint, which will compare the files changed between two commits :

```
curl -X GET -u USERNAME:APPPASSWORD https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/diffstat/f179ff7..00f0e77
```

The first commit is the commit you want to see the changes. The second commit represents the state to which we want to compare the first commit.

If you provide only one commit ID to that endpoint, it will calculate the diff spec against the first parent of the specified commit.

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

Thank you, [@yashodperera](/t5/user/viewprofilepage/user-id/5216608) !

Patrik S

comments: author: yashodperera
body: Hi [@Patrik S](/t5/user/viewprofilepage/user-id/4603309) Thank you you are a lifesaver.


Tags: bitbucket-cloud

cloud
Pipelines are very slow and failed all the time
Asked by Damien CALLET:

Hi there,

Since yesterday our pipelines are failing because they cannot connect to external archive. Is there currently a problem?

Thank you.


Answers:
author: Aron Gombas _Midori_
body: There was a Bitbucket incident on Monday which caused all our pipelines to fail with some sort of a "system error". (They didn't even start to be precise.)

Then Atlassian marked the incident fixed, and a few hours later our pipelines went green. Yesterday it was already reliable.


Tags: bitbucket-cloud

cloud
How to use git hooks with Sourcetree Gitflow?
Asked by Celso Rangel Jr.:

I am trying to trigger Git Hooks from the use of Sourcetree's embedded GitFlow functionality.

Basically, I am trying to do something very simple: run a git hook that tags the Master branch after a successful merge (using, for example, the "Release" in GitFlow).

The script works and triggers fine if I do the merge manually. However, when using GitFlow "Finish Release", the script never triggers; even though I understand it is doing precisely a merge.

What gives?


Answers:
author: minnsey
body: Hi  

Does the hook trigger if you run the Git flow commands from the terminal or command line?  

If it does, I would expect Sourcetree to do the same but if it is Git-Flow failing then not.  

Perhaps this is of help? <https://stackoverflow.com/questions/48524221/git-flow-avh-edition-hooks-are-not-executed>  

Git-Flow also seems to have its own hook mechanism  
<https://github.com/petervanderdoes/gitflow-avh/tree/develop/hooks>  

<https://github.com/jaspernbrouwer/git-flow-hooks>

comments: author: Celso Rangel Jr.
body: You are correct; I would expect running "git flow release finish" to trigger the commit/merge hooks, but they do not.

Git Flow runs on its own hooks, such as:

post-flow-hotfix-finish

post-flow-release-finish

pre-flow-release-finish

Thanks for the tip.


Tags: windows
SQL-like search syntax
Asked by mu88:

I'm new to Sourcetree and I'd like to know whether the 'Search' window supports a SQL-like search syntax.

For example, I'm searching for all commits belonging to the ticket #123 and #456. How can I do this? I naively startet with *123 or 456* , which returns no results, where a single search for *123* or *456* returns the expected commits.

Thanks!


Answers:
author: minnsey
body: Sourcetree does not currently support a query syntax, sorry.  

You can raise a feature request a jira.atlassian.com for Sourcetree if you would like.
Sourcetree version 3.0.17 does not start on win10 64bit
Asked by smathew:

I've tried the following:

1. Uninstalling Sourcetree. Deleting of **/Users/User_name/AppData/Local/Atlassian**Downloading and re-installing Sourcetree.

2. Adding

\<setting name="AutomaticallyCleanUpDictionaryFiles" serializeAs="String"\>  
\<value\>True\</value\>  
\</setting\>

to the user.config file in the Atalassian AppData/Local/... directory

3. Starting as administrator

All suggestions were things that apparently worked at some point or other with users having the same problem.

Thanks for any help or suggestions.


Answers:
author: minnsey
body: Hi   
Can you outline what happens, from running the installer?  

What should happen is the installer runs, showing a splash screen, it should then install to %localappdata%/Sourcetree.  

In that folder there should be, amongst other things, a Sourcetree.exe and an app-#.#.# folder.  
The Sourcetree.exe is a shortcut, managed by the installer, to the real Sourcetree.exe which is inside the versioned folder.  

Sourcetree *should* start either from the Sourcetree.exe or the app-#.#.#/Sourcetree.exe. IN both cases it should show a splash screen and then after a slight pause the UI. This might be the registration wizard if it is a clean install.  

If you do not see the splash screen or the UI, please check in the %localappdata%/Atlassian/Sourcetree/Sourcetree.log file or Windows Event Viewer for any errors. Please post any you find back here.  

Thanks, sorry you are having difficulties.

comments: author: smathew
body: Hi Michael, I appreciate the reply. I have sorted it out only about an hour or two ago - it turns out that it may have been related to my NVIDIA drivers being corrupted or in any case not working as it should have - no idea why but when I updated the drivers, Sourcetree started working again.

I noticed this as another unrelated piece of software had stopped working as well and when trouble-shooting this, the suggested fix was to update my drivers. I did so and that program and Sourcetree started working again!

Are there some dependencies with these drivers that can cause this to happen??

Thanks,

Matt


author: minnsey
body: Thanks for the update.  

We don't have any direct dependencies on drivers, only indirectly through the .NET/WPF GUI framework.  

If possible would you be able to check if there are any Sourcetree related errors in the Event Viewer or %localappdata%/Atlassian/Sourcetree/Sourcetree.log. Knowing what the problem and the cure was, if we had any generated users it might help us support other users in the future.  

thanks
I have Git Repository Set up for Visual Studio and need to Integrate with Azure DevOps
Asked by Kartik:

I have created a Local Git Repository for the Visual Studio and looking to Sync Code changes from my Local to Azure DevOps Branch . Please do share the detailed steps how it can be done using source tree .


Answers:
author: minnsey
body: Hi  

Was the repository created locally? Do you already have a remote repository setup in DevOps, if so is it set as the remote for your local repository?  

Assuming you have only created a local repository and you have it open in Sourcetree. Then you will need to create a new repository in Azure DevOps, using the DevOps website. Once you have done that you can take that remote repository's clone URL and in Sourcetree open the Repository Settings, the cog in the upper right of the repository view, in there you can add a remote, call it origin, set it as default and add the remote url.  

This should then allow you to commit and push your changes to the remote repository.
Authentification failed when trying to add gitlab remote repositories
Asked by Thomas Rouaux:

Sourcetree 3.0.17

++Steps to reproduce++

1. Click on the Remote tab
2. Click Add an account
3. Hosting service select gitlab
4. Click refresh personnal acces token
5. Enter your credentials

++Result++

Authentification failed


Answers:
author: minnsey
body: Hi  
Please ensure you are using a Personal Access Token rather than your GitLab password  
<https://docs.gitlab.com/ee/api/#personal-access-tokens>
After updating I can no longer see private repositories from Github. Please Help.
Asked by Michael Young:

I was able to see my private repos from GitHub on sourcetree, updated sourcetree today (I've put it off for a while now) and now I can no longer see my private repos. I can still add them via URL, but I can't clone / see them from the remote tab anymore. Is there a way I can get this functionality back?


Answers:
author: Ana Retamal
body: Hi Scott, welcome to the Community!

Has your Github configuration been removed from Sourcetree somehow? You can check or add your account following the steps at [Connect your Github account](https://confluence.atlassian.com/get-started-with-sourcetree/connect-your-bitbucket-or-github-account-847359096.html).

Let us know!

Ana

comments: author: Michael Young
body: Hello Ana,

Thank you for the reply.

My account is still connected, I'd actually removed it and added it back as well as changed the protocol / authentication mediums around to see if maybe that would help me see them.

My public repositories on the account still populate the list, but not my private ones.


Tags: github
Change default working copy location when cloning from BitBucket
Asked by Andy Zhou:

I'm just starting to use SourceTree 3.0.17, and cannot figure out how to change the default working copy (local repo) location during cloning from BitBucket. The earlier SourceTree version can follow Tools \> Options \> General \> Misc (<https://community.atlassian.com/t5/Questions/Change-default-repo-location/qaq-p/174857>), or similar to specify a custom path where all the cloned repos will be located. But the latest version does not seem to have this option anymore.

We are using Eclipse for most of the development work, so it's preferable to have SourceTree clone to Eclipse workspace by default. Otherwise, we have to manually change the path for each clone.

Thanks in advance.

Andy


Answers:
author: minnsey
body: Hi  

It should work form the Tools/Options/General tab, with the Repo Settings/Project folder option, but it looks like that is currently broken.  

I've raised <https://jira.atlassian.com/browse/SRCTREEWIN-11373> to cover this

comments: author: David J
body: Holy cow, I missed that three times! (I was looking for an existing location :( )

Thanks!


author: Victor Martin
body: thanks


author: Andy Zhou
body: Thanks Michael. Now I see the "Project folder" option, and for some reason I didn't see it before. It's all good now.


Tags: atl-gruland
Adding Bitbucket Account to Sourcetree using SourceTree
Asked by Lehlohonolo Mbele:

Whenever I try adding my bitbucket account to Sourcetree, I get redirected to Bitbucket. However bitbucket prompts me to open Tower.

Here are the screenshot of what's happening:

![Screenshot 2019-02-14 at 14.59.35.png](/t5/image/serverpage/image-id/45688i7095A786CFBB024B/image-size/large?v=v2&px=999 "Screenshot 2019-02-14 at 14.59.35.png")

And then here's what Bitbucket prompts me to do:

![Screenshot 2019-02-14 at 14.59.26.png](/t5/image/serverpage/image-id/45691iE5107D1C2E4CAA27/image-size/large?v=v2&px=999 "Screenshot 2019-02-14 at 14.59.26.png")

I do not have Tower installed in my machine and I don't want to use Tower(which is paid).


Answers:
author: Mike Corsaro
body: Hello! So it looks like you had Tower installed in the past, and they decided to do something naughty and claim the "sourcetree://" URL protocol handler. You'll need to remove that handler and try the oauth login again. [Instructions for how to remove it can be found here.](https://superuser.com/questions/266023/how-to-remove-an-url-protocol-default-handler)


Tags: bitbucket
I don't have time for this
Asked by Toby Hefflin:

I need to install this pain in the ass software but I'm too dumb or it's too complicated. Do I need bitbucket or not?


Answers:
author: Ana Retamal
body: Hi Toby,

You'll need either a Bitbucket Cloud or Bitbucket Server account to register Sourcetree. Are you having any issues creating or logging into your account? Keep in mind that you'll need to activate your Atlassian account if you haven't already to be able to access Bitbucket Cloud (the Atlassian account is used to access all the Atlassian services and products, such as this community).

Let us know if you need anything else!

Best regards,

Ana

comments: author: Toby Hefflin
body: You're saying I could be using this account but it's not activated?

I'm already using Sourcetree just fine on my old computer (does this mean i'm already using a bitbucket account?), I just need to use it on my new computer.

Thank you, sorry about the frustrated sass
In Sourcetree, how can I get a copy of a previous version of a file from the remote repository?
Asked by steve:

I am a newbie. I just installed the latest version of Sourcetree to be a GUI for Git. . I do not know much about Git, FYI. I see in the Git toolbar a Fetch icon. I looked in the documentation for what Fetch does and did not find anything? I wondered if Fetch will do the job? I see a dashed circle around the Fetch icon. What is the significance of a dashed circle versus a solid circle? (The remote repository I am working with is <https://bitbucket.org/uiprose/alpha_system/src/master/>

)


Answers:
author: minnsey
body: Hi  
Fetch simply pulls any changes from the remote repository into your local copy, i.e. the .git folder. It will not change your local working copy, hence the dotted circle, to do that you need to Pull.  

To view the contents of a remote version of a file in Sourcetree.  

In the File Status view select the Show **All** filelisting option, then find the file of interest. Alternatively use the **Search** option on the same screen.  

Once you can select your required file use the context menu to **Log Selected...** this will give you a history of the file.   

You can then select the version you want and use the context menu to **Open Selected** this will create a temporary copy of the file at that revision and open it for you.

comments: author: steve
body: I found the following web page to be very useful. It includes a discussion of:The major difference between Git and any other VCS (version control system) .  

<https://git-scm.com/book/en/v1/Getting-Started-Git-Basics>  
Here are some highlights from the above page:
> The major difference between Git and any other VCS (version control system) (Subversion and friends included) is the way Git thinks about its data.
>
> Now, pay attention. This is the main thing to remember about Git if you want the rest of your learning process to go smoothly. Git has three main states that your files can reside in: committed, modified, and staged. Committed means that the data is safely stored in your local database (repository). Modified means that you have changed the file but have not committed it to your database yet. Staged means that you have marked a modified file in its current version to go into your next commit snapshot.

This means that Commit does not modify the remote repository by itself, only when you do a Push at the same time or at a later time as a Commit.  
I thought that Commit makes your changes visible to other people, but I was wrong. Push is what accomplishes that. Pull is what merges other peoples changes into the files you have modified (but not pushed) and what copies the changes others have made to files you have not modified.

The following web page explains more about what commit really does.

<https://git-scm.com/book/en/v1/Git-Basics-Recording-Changes-to-the-Repository>  
The above web page is part of a useful chapter that is introduced here:  
<https://git-scm.com/book/en/v1/Git-Basics>  

The following web page explains what push and pull really do.<https://git-scm.com/book/en/v1/Git-Basics-Working-with-Remotes>


Tags: bitbucket
Pull Uncommited Changes on Remote Machine
Asked by edgardavidp:

I've been using SourceTree for about 3 months now, so far I love it.

I would like to know if its possible or if it would be possible to Pull uncommitted changes from a remote machine. It probably doesn't make sense, but we have had people leave the development team and have their last projects not committed(bad practice I know) and then having to redo some code.

It would be nice to be able to know that someone is working on the Repository and somehow pull the uncommitted changed to a new branch just to check them or save them for later.


Answers:
author: edgardavidp
body: Wondering if my question could morph into a suggestion.

Maybe a setting to automatically commit to a WorkInProgress branch or something everytime you have uncommited changes at a defined time in the Day or on close...


author: Marty
body: From what I know of git I don't think this is possible... but I'm not a SourceTree expert so will see what others say.
Im getting the following error when I try to push to remote
Asked by Rodney Brown:

![Screen Shot 2019-02-13 at 6.03.40 PM.png](/t5/image/serverpage/image-id/45575iF8CA21FE23274B3C/image-size/large?v=v2&px=999 "Screen Shot 2019-02-13 at 6.03.40 PM.png")

please email at rbrown@fulfillment.com


Answers:
author: bgannin
body: Hi [@Rodney Brown](/t5/user/viewprofilepage/user-id/50260),

The SSH agent did not properly load your key. You can fix this by running the following command in Terminal:

```
ssh-add ~/.ssh/your_key_name
```

Hope that helps,

Brian Ganninger  
Principal Developer, Sourcetree

comments: author: Rodney Brown
body: Thanks Brian That did the trick. I was experiencing the same problem about a week or so ago. I did the ssh-add then to correct it. I am not sure why its reoccurring. Again, thanks for your help
SourceTree requires registration at launch every time and crashes when closing
Asked by jaredhughestsd:

My SourceTree is requiring me to go through the registration process every time I launch it, it also crashes when I close the application.

Not sure if there are settings to avoid the registration process every time or if the crashing is just a known bug.

Version: 3.0.17


Answers:
author: minnsey
body: Hi  

Sourcetree should not be re-running the registration process on every re-start.  

Can I check a couple of things. Where are you running Sourcetree from? It should essentially be by running %localappdata%/Sourcetree/Sourcetree.exe.   

After you run the registration process it should create a file %localappdata%/Atlassian/Sourcetree/accounts.json, this should include details, not passwords, of the registration account. Does that exist?  

Additionally Sourcetree should update two settings in the %localappdata%/Atlassian/Sourcetree.exe_url_{hash}/3.0.17/user.config  

AgreedToEULA = true  
AgreedToEULAVersion = 20160201  

If both the accounts.json and the 2 user.config settings are there, then the welcome wizard should **not**run again

comments: author: jaredhughestsd
body: So my accounts.json has details however I have three different %localappdata%/Atlassian/Sourcetree.exe_url_{hash}/3.0.17/user.config files and none of them have these as settings. Is this something i should add to all three or just the 3.17.2659 user.config?

I'm guessing they will also be strings?

AgreedToEULA = true  
AgreedToEULAVersion = 20160201


author: minnsey
body: Hmm they should be written automatically and there should only be one per Sourcetree version.  

However the simplest way would be to delete all the %localappdata%/Atlassian/Sourcetree.exe_url_{hash} folders then Sourcetree it will recreate the missing folder and then there will only be one user.config  

They would need to be set in the following format  

\<setting name="AgreedToEULA" serializeAs="String"\>  
\<value\>True\</value\>  
\</setting\>  
\<setting name="AgreedToEULAVersion" serializeAs="String"\>  
\<value\>20160201\</value\>  
\</setting\>


author: jaredhughestsd
body: Hey Michael,

Just had time to try this and it worked perfectly!!! Thank you so much for the help


Tags: bitbucket