pushの権限を持っていないリモートリポジトリに更新内容を反映する

pushの権限を持っていない環境(ユーザ)で適用した更新を、リモートリポジトリに反映したい時がある。
例えば、本番環境でのhotfixなど。

今のところ以下のような手順で行っている。
(localとproductionという2つのホスト上で作業をしているとする。localが自分の環境。productionが本番環境)

大まかには

  1. productionでformat-patchでpatchの作成
  2. localでpatchを取り込んでリモートリポジトリにpush
  3. productionでリモートリポジトリの変更をpull

実際の内容

production
git add . #変更をaddして
git commit -m "this-is-hot-fix" #commit
git format-patch HEAD~ ## 0001-*.patchが作成される
local
scp production:/srv/this/is/production/env/<0001-*.patch> .
git am <0001-*.patch>
git push origin
production
git reset --hard HEAD~
git pull origin