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

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

Mix accounts

I have two Bitbucket accounts using two different Email address. Everything looks working fine except one strange behavior.:

If I log in into account #2 and get into the Commits screen I see the commit history however the Icon picture at the begging of the line is the picture that related to account #1 and if I click on it I get a "You'r never been here" screen. Beside that everything works fine. The icon on the bottom left corner of the screen is correct and I can click on it and get the correct profile.

Could't find any way to fix that. 

1 answer

1 accepted

2 votes
Answer accepted

Hello @eitan.m,

Welcome to the Community.

The commit contains author name and email – this is configured in Git client on your local machine. Bitbucket then resolves the user that created a commit by looking at that author metadata.

So it looks like you used the email linked to your account#1 when you created commits (as in, it is configured in Git client), then you pushed these commits to account#2's repository (committer and pusher can be different people, and in fact, author could be different both of these too). Bitbucket correctly resolved commit author using account#1's email to account#1 — this is why you see the avatar of account#1. Now, account#1 has private profile page, so account#2 can't access it — this is why you see "You were never here" error page.

A way to fix would be to override at least user.email property in Git config for that repository (or by other means, Git config is hierarchical). Here's the Git config documentation page for details.

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

Daniil,

Thanks for your clear answer. This really fixed the issue. Just one additional question -  if I perform new commits the user is now the correct user. Is there any way to change the history - i.e. the user name with previous commits?

Thanks,

Eitan

No worries, always happy to help :)

Is there any way to change the history?

Yes, what you need is called Git history rewrite. Very powerful tool, so be careful. Also note that if there's more than one consumer of that repo, they might need to do some untangling if they happened to fetch the history you've rewritten before you did that and started some work on top of it. It's worth reading this article first to understand the possible implications.

Here's the related Git documentation page. Simple but manual way is to use interactive rebase and amend every commit. However if you have more than a couple of commits to change, you might want to go with filter-branch instead. Here's a SO answer that suggests a script which I believe does exactly what you need.

Let me know if you have any questions.

Cheers,
Daniil

Daniil,

Thanks, it really helps.

Best Regards,

Eitan 

Like Daniil Penkin likes this

Suggest an answer

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

Powering DevOps with Bitbucket Server & Data Center

Hi everyone, The Cloud team recently announced 12 new DevOps features that help developers ship better code, faster   ! While we’re all excited about the new improvements to Bitbucket ...

1,869 views 0 7
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