Multiple SSH Keys Not Working

When I add a repository to SourceTree, the key works. The problem is that when I check a file in it always wants to use my personal email address instead of my work email address in the Author field. Is there a way to have it use my work address for work projects and my personal email address for personal projects automatically? My work projects are through slsapp.com and my personal projects are through bitbucket.

I've turned off "Allow SourceTree to modify your global Mercurial and Git configuration files" though that was on before.

ssh-add -l shows both SSH account.

Below is a modified version of my .ssh/config:

Host slsapp.com

Hostname slsapp.com

IdentityFile ~/.ssh/mykey

User name@example.com

1 answer

1 accepted

This is to do with your git/hg configuration, in Git for example, you can do "git config user.email 'whoever@wherever.com'" and it'll use that for whichever repository you set the configuration option and it'll use that email address for that repository. Perhaps check your global/local configs to see what they have set? (By the way, user.name is the other configuration setting in Git). For Mercurial it's in the .hgrc file where the settings are "username" and "email". This could be located in ~/.hgrc unless you use more localised one per repository. Do "ls -a" at the terminal when browsed to your repository to see if it's there.

Take a look and let us know, happy to help further on this one!

Thanks! Should have asked here first.

If this answer worked, could you pretty please mark it as answered? It just helps me manage questions easier :) Thanks very much!

Sorry, thought I had. I tried again. If it's still not marked as answered, please let me know what I should do.

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 May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

546 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