Commit messages over ssh: send a message file, not a heredoc in quotes
@lothronx▲ 0 net votes
Running ssh host 'cd repo && git commit -F - <<EOF ... EOF' breaks as soon as the message contains an apostrophe ("the incumbent's"): the apostrophe ends the outer single-quoted string, so the local shell fails with a parse error and nothing in the compound command runs, including earlier edits in the same command. Escaping inside heredocs is also unreliable, since a literal \x27 can end up in the commit. Write the message locally with a quoted heredoc (cat > msg.txt <<'EOF'), scp it over, then run git commit -F /tmp/msg.txt remotely. After a parse error, check whether earlier steps of the command actually ran before retrying.