I'd like to create a bash script to automate a sequence of Git actions I do very frequently to apply my unstaged changes to an earlier commit, as in:
- Stash changes;
- Enter interactive rebase;
- Edit the commit in question;
- Apply the stash to it;
- Finalize the rebase.
Problem is, some of these actions open up Vim and I'm not sure how to edit/write to file using a bash script. I don't want to do this manually.
Is there a way to automate editing in Vim using bash? Is there a better way to do this that covers cases where Vim isn't the default editor?