Git

Guide Git version control workflows with commands for branching, merging, and conflict resolution.

17|4|Updated Oct 21, 2025
One-click install
npx skills add https://github.com/oriolrius/pki-manager-web --skill git-oriolrius
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Git
Source: https://github.com/oriolrius/pki-manager-web/tree/main/.claude/skills/git
Command: npx skills add https://github.com/oriolrius/pki-manager-web --skill git-oriolrius

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Git provides a structured approach to version control, enabling teams to track changes, collaborate safely, and revert mistakes without disrupting ongoing work.

Core Features & Use Cases

  • Repository Initialization and Setup: Create new repos, clone existing ones, and configure remotes and user identity.
  • Daily Workflow: Check status, stage changes, commit with meaningful messages, and push to remote branches.
  • Branching and Merging: Create feature branches, switch contexts, merge changes, and resolve conflicts efficiently.
  • Advanced Workflows: Rebasing, cherry-picking, and history rewriting with safeguards and previews.
  • Troubleshooting & Best Practices: Undo changes safely, view history, diagnose conflicts, and protect main branches.

Quick Start

Initialize a repository, create a feature branch, commit changes with a clear message, and push to a remote repository.

Frequently Asked Questions about Git

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

FAQPage Schema
How do I resolve merge conflicts in a Git branch?

To resolve merge conflicts in Git, identify the conflicting files, edit the code between the conflict markers to keep the desired changes, stage the resolved files, and commit the final merge. This allows safe integration of divergent work.

What is the best way to undo commits without losing uncommitted work?

The best way to undo commits while keeping uncommitted work is using Git's soft reset or checkout commands. These safeguards allow you to safely revert history and protect ongoing changes in your working directory.

How do I rebase a feature branch onto a main branch?

To rebase a feature branch onto main, switch to the feature branch and run the rebase command against main. This rewrites commit history by applying your changes on top of the latest main commits, requiring conflict resolution if overlapping edits exist.

Can I safely rewrite Git history before pushing to a remote repository?

You can safely rewrite Git history before pushing to a remote repository by using interactive rebasing with previews. This allows you to modify or squash local commits without disrupting shared remote branches or ongoing team work.

Why should I use feature branches for collaborative version control?

Feature branches isolate new development from the main branch, enabling teams to track changes and collaborate safely. This workflow prevents unfinished code from disrupting ongoing work and simplifies conflict resolution during merging.

What Git commands do I need for a daily version control workflow?

A daily Git workflow requires checking status to see changes, staging modified files, committing with meaningful messages, and pushing to remote branches. This provides a structured approach to track changes and maintain reliable history.