best git commit graph for atlassian bitbucket server

Control Freak - Adjusting Authorship Info

Control Freak rejects commits where the author name and email do not exactly match the corresponding name and email values stored in Bitbucket's user directory.

The good news: adjusting authorship data in a branch's tip commit is easy!

The bad news: adjusting authorship data in commits behind the tip (older commits) is much harder.

Set Your Local Git Config First

Make sure your git config has proper name and email values that match your Bitbucket user directory! Like so:

git config --global "User Name" 
git config --global

Adjusting The Tip Commit

The following command will rewrite the current branch's tip commit object. The "--reset-author" flag injects the latest name and email data from your git config:

git commit --amend --reset-author

Adjusting Older Commits

There are two approaches:

  1. Squash Method: Squash your branch into a single tip commit, and then use the much easier "Adjusting The Tip Commit" technique above. There are several ways to squash a branch. I recommend the following squash technique based on git reset --soft (assumes you branched from origin/master):
    git reset --soft $(git merge-base HEAD origin/master)
    git commit
  2. Interactive Rebase Method: Run an interactive rebase ("git rebase --interactive"), and mark every commit with "e" or "edit". The rebase will halt for each commit. Every time the rebase halts type the following commands:
    git commit --amend --reset-author --no-edit
    git rebase --continue
    The first of those commands injects your updated authorship metadata into the current commit. Keep typing those two commands (both together each time) until you finally see the message "No rebase in progress?".