Sometimes, while working on a branch, I want to add a new commit before the first commit.

The best way I found until now to do this are the following steps.

  1. While on the work branch, make an empty commit with git commit --allow-empty -m "Empty commit"
  2. Interactively rebase on the branch from which we checked out, move the empty commit to be the first one and choose to edit it
  3. While in edit of the empty commit make the wanted changes and git commit --amend them to the empty commit
  4. git rebase --continue and fix conflicts if needed