3 ms·
It's not clear to me exactly what you mean. Based on adding the text file, which sounds like you're creating a placeholder commit, you might not know about 'git
by throwaway_au_1 4y ago
It's not clear to me exactly what you mean. Based on adding the text file, which sounds like you're creating a placeholder commit, you might not know about 'git commit --allow-empty' which may serve you better.
Not exactly sure of your order of events wrt inserting a commit and editing it (I.e. edit commit message? Or changes?) and modifying it (I.e. see previous) but am happy to try and help if you want to flesh out your example a little more.
- throwaway_au_1 4y agoTo speculate, maybe you haven't heard of fixup/squash. E.g. Commit 1 Commit 2 Commit 3 Using an empty fixup commit, e.g. git commit --allow-empty --fixup=commit2hash You would end up with Commit 1 Commit 2 Commit 3 fixup! Commit 2 Which will adjust automatically (when starting interactive rebase with autosquash) to Commit 1 Commit 2 fixup! Commit 2 Commit 3 You could then simply change the rebase 'fixup' instruction to 'reword' to edit/remove the 'fixup!' part of the message, or 'edit' to continue the rebase uo until that commit and then stop. That said, again, not clear on your use case but maybe that might help you or another reader.