Git のフック機能(pre-push)を使い、対象のブランチ(例: csv-history)が push されそうになったときに自動でエラーを出して処理をキャンセルする方法。

.git/hooks/pre-push に以下のスクリプトを配置することで、対象ブランチへの push を禁止することができます。

#!/bin/sh

protected_branch="history"
current_branch=$(git symbolic-ref --short HEAD)

if [ "$current_branch" = "$protected_branch" ]; then
  echo "You are trying to push to the protected branch '$protected_branch'."
  echo "Please switch to a different branch before pushing."
  exit 1
fi

exit 0

面倒な場合は以下のコマンドで直接フックを作成することもできます。

cat << 'EOF' > .git/hooks/pre-push
#!/bin/sh

protected_branch="history"
current_branch=$(git symbolic-ref --short HEAD)

if [ "$current_branch" = "$protected_branch" ]; then
  echo "You are trying to push to the protected branch '$protected_branch'."
  echo "Please switch to a different branch before pushing."
  exit 1
fi

exit 0
EOF

echo の部分を日本語にしたいなら、

echo "保護されたブランチ '$protected_branch' に push しようとしています。"
echo "push する前に別のブランチに切り替えてください。"

と書き換えれば OK です。