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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,456,603
Community Members
 
Community Events
176
Community Groups

Can I alter the account I committed with, after the fact?

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?

1 answer

0 votes

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:

  • taking a backup of the repo (a clone with the --mirror flag) before you proceed
  • test the process first in a fork of the repo instead of the repo where you want to make this change. This way you can check if the fork is in good shape after you make these changes, and before you push to the repo you want to change.

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

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Site Admin
TAGS

Atlassian Community Events