Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Mix accounts

eitan.m February 10, 2020

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
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 10, 2020

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

eitan.m February 10, 2020

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

Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 10, 2020

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

eitan.m February 10, 2020

Daniil,

Thanks, it really helps.

Best Regards,

Eitan 

Like Daniil Penkin likes this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events