SourceTree CLI public key problem

Hello,

I set up Bitbucket and am using SourceTree to communicate

with my repository. I use SSH, and everything works fine

with the SourceTree graphical interface: i am able to

clone repositories, make commits and push/pull requests.

But when I open the CLI integrated in SourceTree (MINGW32),

then i am not able to clone repositories or make push commands.

When i attempt to do this, i get the following from the cLI:

******

Permission denied (publickey).

fatal: Could not read from remote repository.

Please make sure you have the correct access rights

and the repository exists.

******

I get this error messages when doing the following command:

git clone <repository>

git push (after successfull commit)

The following commands to work in the CLI:

git status

git log

git branch --all

git commit

git add --all

I am using a WIN7 machine.

Please help!

6 answers

Have you resolved this? I had a similar issue and it was because I was using the https URL for access. I just had to change it to the ssh version and it worked just fine.

Run this:

git remote -v

If origin shows an address starting with `https://yourhost`, change it to the ssh version:

git remote set-url origin git@yourhost.com:yourproject.git

To do this I ended up exporting my .ppk to and OpenSSH compatible public/private key under dkassa\.ssh and following this advice to add a .bashrc. It's not as integrated as I was hoping for but it works.

http://stackoverflow.com/questions/5727555/remember-password-git-bash-under-windows

Embedded or system git?

I dont know what you mean by embedded or system git. I have a laptop with intel processor running Win7. I downloaded Sourcetree from the website and installed it.

Check "Tools" > "Options", and choose the "Git" tab and look in "Git Version".

"Embedded" is a copy of Git that is packaged with SourceTree. "System" is an external install of Git. It matters because it can effect how the CLI Git runs and how it and SourceTree share data.

I tried both System Git and Embedded Git but still get the same problem. I have System Git Version 1.9.4 and Embedded Git Version 1.8.3.

Maybe this info helps: When I installed SourceTree, i used the key generator within Sourcetree and generated the public and private key for my first Bitbucket account. I saved public and private key on my C: drive in FolderA. Then I copied the public key on the Webbrowser into my first Bitbucket Account. I did the same with the second public and private key. So in SourceTree, i log in with my first account to access the repos of my first Bitbucket account and that works fine. For access to the second account, i use the second username and password in Sourcetree and then go to Tools -> Options and choose the folder where my second private key is stored (on folder B on my C: drive). That second way works fine as well in Sourcetree, i can clone repos etc.

But once i open the command line tool, then i am not able to clone repos.

I saw that there is a .ssh folder as well on my C: drive which contains the 3 file github_rsa, github_rsa.pub and know_hosts. I wonder what that has to do with Sourcetree and the command line tool.

Please help!!!

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Monday in Agility Beta

We've moved!

A note to all watchers that we've moved to a new community home... https://community.atlassian.com/t5/Agility/ct-p/agility Please update your notification subscriptions to keep across the ...

97 views 1 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you