You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I have multiple Atlassian accounts.
And via not knowing exactly what I was doing at the time have committed code for one company using the account of a different company.
Can I somehow, change the account attributed to historical commits?
Hi Gavin,
It is possible to change the author of commits, please keep in mind though that the process to do so involves rewriting history. This means that the commit hash of the commits you want to change, as well as any descendants of these commits, is going to change. It would be good to communicate this with your team if you decide to proceed, and also that all users take a new clone of the repo, to avoid pushing back your old commits.
You can check the following knowledge base article, which has detailed steps on how to achieve that:
Please note that pushing back the altered commits to the repo with the --force flag (detailed in the last step of the doc) is a risky operation that will completely overwrite all commits. I would strongly recommend:
If the branch where you want to push these changes has a branch restriction "Rewriting branch history is not allowed", it will not be possible to force push unless the branch permission is set to "Allow rewriting branch history".
In order to prevent this issue from happening in the future, you can set a different author email for each of your local repos:
1) From the command line, navigate to the directory of a repo
2) Use the following command to set the author email for this repo:
git config user.email "my_email@example.com"
3) Verify the configuration with the command
cat .git/config
Kind regards,
Theodora
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.