It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How do I get commits from sourcetree to connect to my github account?

Hello, 

 

When I set up SourceTree, I did so with a recently created BitBucket account. Everything is working fine, except I would like my commits and pushes to github to be associated with my github account. Currently they're associated with my bitbucket account. 

 

In the sourcetree repository browser, I've tried adding and setting to default my github account, and I think everything worked, however recent commits since this account change are still associated with my bitbucket account. What should I try next? 

 

Most of the questions I've see on this topic so far don't seem to match my issue, and I haven't found any resolution through the ones I've tried. Any help greatly appreciated!

1 answer

0 votes
minnsey Atlassian Team Feb 27, 2019

Hi

Can you provide more context?

If I've understood correctly you have an existing local repository where the remote is configured to use Bitbucket, but you would like to change this to be GitHub?

If that is correct you would need to add GitHub remotes in the Repository Settings, the cog in the upper right of the repository tab and then select the GitHub remote when pushing.

Is this what you are trying to do?

Hi Michael, thanks for the response.

I think that's correct.

Currently my local repo is connected through Sourcetree to the correct GitHub remote repo. However the account associated with my commits to the GitHub repo is not my GitHub account. I think it's the account I set up with Bitbucket when I was setting up Sourcetree. Is there any way to change the account associated with commits and pushes through Sourcetree? 

Thanks very much

minnsey Atlassian Team Feb 28, 2019

OK, is it possible you are referring to the commit author and email address? If so you can edit them in the Tools/Options/General tab.

Alternatively if you want to add other accounts to remote services you can use the Tools/Options/Authentication tab and then associate the account to your repo in the Repository Settings.

So I don't have a Tools/Options/General menu option (in Sourcetree if that's what you meant), but I can see where I would change my Full Name and Email address in the General tab of Settings, but will this link my commits to my GitHub account? I've tried changing these and see no difference in the commit author on GitHub.

Here's some screen caps that will hopefully explain better than I can, here's what's currently happening:

githubName.jpeg

And here's what I want to happen:

 

githubAccount.jpeg

I've tried adding my GitHub account through the Accounts tab in Preferences for Sourcetree, but when I try to connect to the username Katy6514 via SSH, I save it and an error pops up saying something about how there was a problem adding the SSH key to my account and I need to manually add the key. I can't get the full error because it doesn't all fit on the popup and as soon as I click on it, it slides off screen and doesn't open a page in the browser like I expect.

When I click on "Connect Account" in the settings panel for adding a new account, chrome fails to open this link: (https://github.com/login/oauth/authorize?client_id=6c1278ba8f154ef74ff0&redirect_uri=sourcetree%3A%2F%2Foauth&response_type=code) it just hangs. When I copy/paste that link into Safari, I'm asked by Safari if I want to open Sourcetree (which is already open). When I click "ok", it just takes me back to that same settings tab for connecting an account, with no noticeable change. When I click "save" anyways, the same error pops up in the right hand corner of my screen saying there was an error adding my SSH key to my GitHub account.

I've tried to add the SSH key supplied from Sourcetree to my GitHub account manually (as suggested by the error popup), and when I try to save the SSH key in GitHub, I'm told it's already in use. Not really sure what to try now.

Thanks very much for your assistance on this, I'm not really sure if this is a problem on GitHub's side or with how I've set up SourceTree, but I really would like all this work I'm doing to be associated with my GitHub account!

minnsey Atlassian Team Feb 28, 2019

Ah you are on mac?

It does sound like you need to change the GitHub account you are using. I'll ask on of the mac Devs to get back to you.

Yes, on a mac, sorry I forgot to specify! I appreciate it.

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Sourcetree

Sourcetree for Windows - CVE-2019-11582 - Remote Code Execution vulnerability

A vulnerability has been published today in regards to Sourcetree for Windows.  The goal of this article is to give you a summary of information we have gathered from Atlassian Community as a st...

4,902 views 0 12
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you