The github repo for git-filter-repo has a demo python app that is used to add files to the oldest commit, https://github.com/newren/git-filter-repo/blob/main/contrib/filter-repo-demos/insert-beginning, has a comment saying that it could be done as a one-liner:
git filter-repo --force --commit-callback "if not commit.parents: commit.file_changes.append(FileChange(b'M', $RELATIVE_TO_PROJECT_ROOT_PATHNAME, b'$(git hash-object -w $FILENAME)', b'100644'))"
Given the mix of tools being used here, this isn't making a lot of sense to me. How would the command look running on windows 10, adding a .gitignore file or LICENSE file?
I don't think I would use
git-filter-repofor this; you can just usegit rebase.Run
git rebase -i --rootIn the result pick editor, change
picktoediton the first commit.Back at the shell prompt,
git addthe file(s) you want to add.Run
git rebase --continue