smithery.ai

git-push-remote

Push the current branch to the remote repository with upstream tracking

First seen Mar 22, 2026

Installation

$ npx skills add https://smithery.ai

Similar popular skills

Related neighbors and high-traction skills in the same topics — useful to compare before installing.

Also in this package

Other skills from smithery.ai · top by installs.

npx skills add https://smithery.ai

Browse all from smithery.ai

More details

Agent compatibility

Declared targets from SKILL.md / docs. Unmarked agents are not listed — the skill may still install via the CLI.

Claude Code Not declared
Cursor Not declared
Codex Not declared
GitHub Copilot Not declared
Windsurf Not declared
Gemini CLI Not declared
Cline Not declared
OpenCode Not declared

Package contents

Files included with this skill beyond the listing page.

  • skill md SKILL.md 2,319 B
  • docs SUMMARY.md 94 B

History

  1. First seen on skills.sh
  2. First recorded snapshot · 1 installs

SKILL.md

Git Push Remote

Push the current branch to the remote repository, setting up tracking if needed.

In worktree workflows, run this skill from the ticket's dedicated worktree path.

Inputs

  • worktree_path (recommended): absolute path to the ticket worktree
  • branch (optional): branch name; if omitted, resolve from the worktree

Steps

  1. Resolve working context:

If worktreepath is provided, prefer explicit -C commands: ``bash git -C "{worktreepath}" rev-parse --show-toplevel git -C "{worktree_path}" branch --show-current ``

If branch is not provided, resolve it from the same path.

If branch resolves to empty (detached HEAD), stop and return an actionable error.

  1. Confirm repository/worktree location:

- Always report the resolved top-level path used for push.

  1. Check if upstream is set:

``bash git -C "{worktree_path}" rev-parse --abbrev-ref --symbolic-full-name "@{upstream}" 2>/dev/null ``

  1. Push to remote:

If no upstream is set (new branch): ``bash git -C "{worktree_path}" push -u origin "{branch}" ``

If upstream exists: ``bash git -C "{worktree_path}" push origin "{branch}" ``

Never rely on implicit current directory branch for pushes in multi-worktree workflows.

Error Handling

Push Rejected (Remote Has Changes)

If push is rejected because remote has new commits:

git -C "{worktree_path}" pull --rebase origin "{branch}"
git -C "{worktree_path}" push origin "{branch}"

If there are conflicts during rebase:

  1. Inform the user about the conflicts
  2. List the conflicting files
  3. Ask for guidance on resolution

No Commits to Push

If there are no commits to push, inform the user that the branch is up to date.

Authentication Issues

If authentication fails:

  1. Check if SSH key or token is configured
  2. Suggest running gh auth login for GitHub
  3. Ask user to verify their credentials

Verification

After pushing, verify the push succeeded:

git -C "{worktree_path}" log "origin/{branch}" -1 --oneline

Report the pushed commit hash and message to confirm success.

Also report the worktree path used for the push.