Do I understand correctly that you want to do the following:
- Prepare in advance (somewhere) your rebase interactive file
- Do the rebase without ever opening a text editor (say, on a different machine)
You can do this as follows:
First create a fake text editor: add the following contents to an sh file called edit.sh
cat file > $1
where file refers to some location where you will put the instructions for the interactive rebase.
Make sure edit.sh is executable
Next, run the rebase as follows:
GIT_EDITOR=edit.sh git rebase -i branch_to_rebase_on
Instead of opening an editor; this will open the sh script. The sh script simply writes the instructions for the rebase to the rebase file.