modern-git

Teach modern Git branch and file operations with safer push practices.

1|Updated Jan 26, 2026
One-click install
npx skills add https://github.com/DaleSeo/git-skills --skill modern-git
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: modern-git
Source: https://github.com/DaleSeo/git-skills/tree/main/skills/modern-git
Command: npx skills add https://github.com/DaleSeo/git-skills --skill modern-git

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

Modern Git commands separate concerns, replacing legacy multi-purpose actions like git checkout with clearer, safer alternatives such as git switch and git restore.

Core Features & Use Cases

  • Clear branch operations with git switch, reducing accidental detours.
  • Safer file changes with git restore to discard or restore files precisely.
  • Safer push workflows using --force-with-lease to prevent overwrites in collaborative work.
  • Use-case examples: switching branches, discarding file changes, unstaging files, restoring from specific commits.

Quick Start

Begin using modern Git commands for branches and files in your repository.

Frequently Asked Questions about modern-git

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

FAQPage Schema
How do I switch branches in git without accidentally modifying my files?

Use the modern git switch command instead of the legacy git checkout to change branches safely. Git switch strictly separates branch operations from file modifications, reducing accidental detours and unintended data loss during development workflows.

What is the safest way to discard uncommitted file changes in a git repository?

Use the modern git restore command to discard or restore files precisely. Git restore isolates file manipulation from branch switching, allowing you to safely manage working directory changes without affecting your current HEAD pointer.

How do I safely force push commits when collaborating with other developers?

Use the safe push workflow with the --force-with-lease flag to prevent overwrites. This modern Git practice verifies the remote state before pushing, rejecting the update if a collaborator has already advanced the branch you are trying to overwrite.

Why should I replace git checkout with modern git commands like switch and restore?

Replacing git checkout with modern git commands separates concerns and reduces errors. Git switch handles branch navigation while git restore manages file states, replacing a legacy multi-purpose action with clearer, safer alternatives for typical development scenarios.

When do I need to use git restore instead of git reset to unstage files?

Use git restore to unstage files when you need to precisely discard or restore file contents without altering commit history. Git restore safely manages working directory and staging area states for specific files across various development scenarios.