Git Push

Push local Git commits to a remote repository with upstream handling.

1|1|Updated Feb 21, 2026
One-click install
npx skills add https://github.com/dtsong/claude-code-windows-setup --skill git-push-dtsong
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Git Push
Source: https://github.com/dtsong/claude-code-windows-setup/tree/main/skills/git-workflows/skills/push
Command: npx skills add https://github.com/dtsong/claude-code-windows-setup --skill git-push-dtsong

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill automates the process of pushing local commits to a remote Git repository, intelligently handling upstream configurations and potential conflicts.

Core Features & Use Cases

  • Streamlined Pushing: Pushes commits to the tracking branch with a single command.
  • Upstream Management: Automatically sets the upstream for new branches or pushes to existing ones.
  • Conflict Prevention: Includes checks to prevent pushing if the remote branch has diverged, prompting for a pull first.
  • Safe Force Pushing: Supports --force-with-lease for safe force pushes after rebasing.

Quick Start

Use the git push skill to push your current commits to the remote repository.

Frequently Asked Questions about Git Push

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I push local git commits to a remote repository and set upstream automatically?

To push local git commits and set upstream automatically, the Skill pushes your commits to the tracking branch while intelligently configuring upstream tracking for new branches. It ensures branches are up-to-date before pushing and provides clear output on the push status.

How does git push handle remote branch divergence to prevent conflicts?

Git push handles remote branch divergence by running checks that prevent pushing if the remote repository has diverged. It prompts you to pull first, ensuring your local commits are synchronized with the remote branch before successfully pushing updates.

Can I use safe force pushing with --force-with-lease after rebasing?

Yes, you can use safe force pushing with `--force-with-lease` after rebasing. The Skill supports this specific git push flag to safely overwrite the remote repository history without accidentally discarding commits pushed by other collaborators.

What is the best way to push a new local branch to a remote git repository?

The best way to push a new local branch is using the Skill's upstream management feature. It automates pushing local commits to the remote repository while simultaneously setting the correct upstream configuration for the new branch.

Why does my git push fail when the remote repository has new commits?

Your git push fails when the remote repository has new commits because the Skill includes divergence checks that prevent overwriting remote changes. It prompts you to pull the latest commits first to resolve potential conflicts before pushing.