Push from sourcetree to bitbucket always as team

We have a team on bitbucket called 'Klasse', currently with two members: myself and a colleague. I am the admin.

When I push from Source tree to the origin on bitbucket, this always seems to originate from the 'Klasse' team (the repository is owned by the team). When my colleague does a push, this is reflected correctly as coming from his individual account, and not from the team account.

I've spent all day looking at settings, resetting my ssh keys, restarting sourcetree, etc., to no avail.

Any ideas?

2 answers

Hey Toon,

Sounds like your repository URL is the team URL rather than an individual URL. Check that out to make sure it reflects your user.


I was under the impression that a repository only has one url: git@bitbucket.org:accountname/reponame.git (as mentioned here)

When I change 'accountname' to my username, the push fails because the repository isn't found.

When I log in to bitbucket, I don't see the repository in my profile either. I *am* listed as a user with read, write and admin rights in the repository's access mgmt screen. The team 'klasse' is listed as the owner and my colleague is listed as the creator.

Hey Toon,

The account is the owner, which is the team, so the correct URL format would be the team name. Remember on Bitbucket that multiple people could have the same repo name within teams and of themselves, so there needs to be a per-user identifier. The 'ownership' of the repo is the team in this case.


Yes, I realise there can be only one owner and a team repo only has one url. But how can I get my pushes to be associated with my account instead of the team account?

Hey Toon,

I see what you want now. We don't support this in the user interface, but you can do this:

git config remote.origin.pushurl git@git.example.com:some/repo.git

So when you push it'll use a different URL to the one you're pulling from.

Hope that helps

Well, I *do* want to push updates to the repo on bitbucket, but from my own account instead of the team account.

My colleague seems to be able to do this, but I don't. No idea why, except for the url.

Hey Toon,

Sorry, I'm being stupid (and wasting your time!). Your public key (~/.ssh/id_rsa.pub) being used is for your team. If you do "cat ~/.ssh/id_rsa.pub" at the terminal you'll probably find that the e-mail address is that of the team.

I have the exact same setup, I'm part of a team on Bitbucket, and I use the SSH URL which contains only details of the team (not of me). It identifies me based on my public key.

Hope that helps

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 23, 2018 in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

1,205 views 4 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