Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Push from sourcetree to bitbucket always as team

Toon Van de Putte January 15, 2014

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

0 votes
Toon Van de Putte January 16, 2014

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.

KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 16, 2014

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.

Cheers

Toon Van de Putte January 22, 2014

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?

KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 22, 2014

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

Toon Van de Putte January 22, 2014

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.

KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 22, 2014

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

0 votes
KieranA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 15, 2014

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.

Cheers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events