git-essentials

Provides essential Git commands for version control, branching, and collaboration workflows.

89|5|Updated Mar 25, 2026
One-click install
npx skills add https://github.com/CUHK-AIM-Group/NeuroDiscovery --skill git-essentials-cuhk-aim-group
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: git-essentials
Source: https://github.com/CUHK-AIM-Group/NeuroDiscovery/tree/main/skills/git-essentials
Command: npx skills add https://github.com/CUHK-AIM-Group/NeuroDiscovery --skill git-essentials-cuhk-aim-group

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Managing source code versions, tracking experiment changes, and collaborating on shared repositories requires memorizing dozens of Git commands. This Skill consolidates the essential Git operations into a single reference so you can initialize repositories, commit changes, manage branches, and sync with remotes without searching documentation. ## Core Features & Use Cases - Core Version Control: Initialize repositories, stage and commit changes, view diffs, and browse commit history with log, blame, and bisect. - Branching & Remotes: Create, switch, merge, and delete branches, plus fetch, pull, push, and manage remote origins and forks. - Recovery & History Management: Undo commits with reset and revert, stash work in progress, rebase branches, cherry-pick commits, and manage tags. - Use Case: While iterating on a data processing script, create a feature branch, commit incremental changes, rebase onto main, and push to a shared repository for review. ## Quick Start Ask the assistant to create a new feature branch, commit your current changes with a descriptive message, and push it to the remote repository.

Frequently Asked Questions about git-essentials

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

FAQPage Schema
How do I undo the last Git commit without losing changes?▼

Use git reset --soft HEAD~1 to undo the last commit while keeping all changes staged. To discard the changes entirely, use git reset --hard HEAD~1, or use git revert to create a new commit that safely reverses the changes.

How do I create and switch to a new Git branch?▼

Use git checkout -b feature-name or the modern git switch -c feature-name to create and switch in one step. List existing branches with git branch, and delete a merged branch with git branch -d branch-name.

What is the difference between git merge and git rebase?▼

git merge combines branches by creating a merge commit that preserves history, while git rebase replays your commits on top of another branch for a linear history. Rebase feature branches before merging, but never rebase shared public branches.

How do I recover a deleted Git branch?▼

Run git reflog to find the commit hash where the deleted branch pointed, then recreate it with git checkout -b branch-name commit-hash. The reflog tracks HEAD movements, so recently deleted branches are usually recoverable.

Why should I use git push --force-with-lease instead of --force?▼

git push --force-with-lease only overwrites the remote branch if it matches your last fetched state, preventing accidental deletion of teammates' commits. Plain --force blindly overwrites the remote, which can destroy others' work on shared branches.