Gh Push

非対話セッション(claude-code の remote-control / CI など TTY が無く SSH 鍵パスフレーズを入力できない状況)で git push を通すスキル。remote が SSH URL で `ssh -o BatchMode=yes` による非対話 SSH 認証が実際に通る(agent の鍵・パスフレーズ無しのディスク鍵・macOS キーチェーン鍵のいずれでも可)なら素の SSH push を実行し、非対話 SSH 認証が通らず `git push` が `Permission denied (publickey)` で失敗する場合は、push を HTTPS + gh トークン(credential.helper='!gh auth git-credential')経由へ自動フォールバックして標準入力なしで実行する。「push して」「リモートに反映して」と頼まれたが SSH 認証が使えない、push が publickey で弾かれた、remote-control から push したい、といった場面で使う。`/gh-push` で明示起動も可。GitHub(gh) 前提。

9 starsGit & Code Review Plugin marketplace

Install

Claude Code plugin
/plugin marketplace add yasunori0418/skills

The repo is a Claude Code plugin marketplace. Run /plugin afterwards to pick the plugin that includes this skill.

skills CLI (Claude Code, Cursor, Codex and more)
npx skills add yasunori0418/skills --skill gh-push
Manual install
git clone --depth 1 https://github.com/yasunori0418/skills.git /tmp/skills
mkdir -p ~/.claude/skills
cp -r /tmp/skills/skills/github/gh-push ~/.claude/skills/gh-push

Personal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.

From the SKILL.md

# gh-push — 非対話 push(SSH 優先・gh フォールバック)

## このスキルの目的

非対話セッション(TTY 無し)で `git push` を通す。経路は **決定論的に** 選ぶ:

1. **SSH 優先** — remote が SSH URL で、かつ `ssh -o BatchMode=yes` による非対話 SSH 認証が実際に通るなら、素の `git push` を SSH で実行する。判定は agent の鍵有無ではなく **BatchMode=yes での `ls-remote` が成功するかで直接テスト**する(agent の鍵・パスフレーズ無しのディスク鍵・macOS キーチェーン鍵を区別せず「非対話で通るか」を確かめられる)。`GIT_SSH_COMMAND='ssh -o BatchMode=yes -o ConnectTimeout=5 -o StrictHostKeyChecking=accept-new'` を強制し、パスフレーズ入力プロンプトや接続ハングに落ちず即失敗させる。
2. **gh(HTTPS) フォールバック** — SSH push が失敗した場合、または SSH が使えない(remote が HTTPS / 非対話 SSH 認証テストが失敗)場合は、push 認証を gh の credential helper に肩代わりさせて HTTPS で送る:

   ```
   git -c credential.helper= -c credential.helper='!gh auth git-credential' push <https-url> <branch>
   ```

   `credential.helper=`(空)で既存ヘルパー一覧をリセットし gh ヘルパーだけを使う(`cache`/`oauth` 等の介入を避ける)。remote が SSH URL でも URL を HTTPS に変換して push 先に使うので **origin の設定は変更しない**。

**なぜ SSH を先に試すか**: 「SSH で push できるか」は `ssh -o BatchMode=yes` の `ls-remote` を1回打って直接テストすれば決定論的に判定できる。非対話 SSH が通る環境(Linux で ssh-agent 常駐、macOS のキーチェーン連携、パスフレーズ無しのディスク鍵など)では素の push がそのまま通るため、余計なトークン経由を挟まない。判定の `ls-remote` は push 範囲算出に使うリモート tip 取得と兼ねるので、往復コストは増えない。`ssh-add -l`(agent の鍵一覧)では、agent が空でもディスク鍵やキーチェーン鍵で非対話認証できるケースを取りこぼすため使わない。

判定の `ls-remote` は `refs/heads/<branch>` に限定する(`refs/heads/*` で全ブランチを引かない)。全一覧は使い道が無く、ブランチ数の多いリポジトリでは出力が数百KB に達して抽出処理を壊すため(後述の「異常終了の切り分け」参照)。
Read the full skill on GitHub

Details

Skill name
gh-push
Path
skills/github/gh-push/SKILL.md
License
MIT
Repo updated
18 November 2026

FAQ

What does the Gh Push skill do?

非対話セッション(claude-code の remote-control / CI など TTY が無く SSH 鍵パスフレーズを入力できない状況)で git push を通すスキル。remote が SSH URL で `ssh -o BatchMode=yes` による非対話 SSH 認証が実際に通る(agent の鍵・パスフレーズ無しのディスク鍵・macOS キーチェーン鍵のいずれでも可)なら素の SSH push を実行し、非対話 SSH 認証が通らず `git push` が `Permission denied (publickey)` で失敗する場合は、push を HTTPS + gh トークン(credential.helper='!gh auth git-credential')経由へ自動フォールバックして標準入力なしで実行する。「push して」「リモートに反映して」と頼まれたが SSH 認証が使えない、push が publickey で弾かれた、remote-control から push したい、といった場面で使う。`/gh-push` で明示起動も可。GitHub(gh) 前提。

How do I install the Gh Push skill?

Claude Code plugin: /plugin marketplace add yasunori0418/skills. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.

Is Gh Push popular?

It lives in yasunori0418/skills, which has 9 GitHub stars and 0 forks.

Related skills

Agent Teams

9

yasunori0418/skills

Claude Code の並列エージェント(agent teams・teammate)の後始末と無応答時の打ち切りルール。`name` を付けて Agent を起動するとき、TeamCreate でチームを組むとき、teammate から `idle_notification` が届いたとき、評価ループ等で次のイテレーションのエージェントを起動する前、エージェントの返信が届かないときに参照する。`name` を付けない通常のサブエージェント起動だけなら対象外。

AI, LLMs & Agents

Basic Design

9

yasunori0418/skills

spec.md の REQ-# を入力に、機能一覧・モジュール構成・インターフェース・データフローを持つ docs/dev/<対象>/basic-design.md を作成・改訂するスキル。/basic-design <対象名> で明示的に呼び出されたときのみ使用する。

Writing & Content

Biz Translate

9

yasunori0418/skills

技術的な内容を、技術用語を排したビジネス職向けの平易な説明文に翻訳する。`/biz-translate` と明示的に呼ばれたときのみ実行する。

Writing & Content

Github

5

cellrishi-code/claude-skills-atlas

Use GitHub safely through the GitHub CLI (gh). Use when the user asks to inspect a GitHub repository, issue, pull request, branch, commit, workflow run, create or update GitHub content, or open a pull request.

Git & Code Review

Gh Fetch

9

yasunori0418/skills

非対話セッション(claude-code の remote-control / CI など TTY が無く SSH 鍵パスフレーズを入力できない状況)で git fetch / pull を通すスキル。remote が SSH URL で `ssh -o BatchMode=yes` による非対話 SSH 認証が実際に通る(agent の鍵・パスフレーズ無しのディスク鍵・macOS キーチェーン鍵のいずれでも可)なら素の SSH fetch を実行し、非対話 SSH 認証が通らず `git fetch`/`git pull` が `Permission denied (publickey)` で失敗する場合は、取り込みを HTTPS + gh トークン(credential.helper='!gh auth git-credential')経由へ自動フォールバックして標準入力なしで実行する。「fetch して」「pull して」「リモートの変更を取り込んで」「最新を取ってきて」と頼まれたが SSH 認証が使えない、fetch/pull が publickey で弾かれた、remote-control からリモートの更新を取り込みたい、といった場面で使う。gh-push の取り込み(incoming)版。`/gh-fetch` で明示起動も可。GitHub(gh) 前提。

Git & Code Review

Nix Devenv

9

yasunori0418/skills

Nix + flake-parts 開発環境の構築パターン: root flake.nix(成果物)+ dev/flake.nix(devShell + CI シェル)を direnv で読み込む構成、および GitHub Actions CI テンプレートを提供する。このスキルは /nix-devenv と明示的に呼び出されたときのみ使用する。キーワードマッチによる自動起動はしない。

Git & Code Review

Browse the most popular Claude skills, all git & code review skills, or write your own with the skills generator.