ruk·si

Git
Add Content to a Past Commit

Updated at 2018-05-18 10:23

If you are working on the master branch.

# find the commit you want to edit
git log
# take the commit id of the ONE STEP OLDER COMMIT
git rebase -i COMMIT_ID

OR

If you are in a separate branch.

git rebase -i master
# find the commit you want to edit and change it to `edit`. `:wq`
# do your changes and then repeate the following until resolved.

THEN

git add .
git rebase --continue