Git Switch To Main — Git skill for Claude Code
Switch to the main branch and pull the latest changes.
How to install Git Switch To Main
Installs to ~/.claude/commands/jesus-seijas-sp-claude-node-setup-git-switch-to-main.md
mkdir -p ~/.claude/commands && curl -fsSL https://raw.githubusercontent.com/jesus-seijas-sp/claude-node-setup/HEAD/.claude/commands/git-switch-to-main.md -o ~/.claude/commands/jesus-seijas-sp-claude-node-setup-git-switch-to-main.md Restart Claude Code, or start a new session, for it to be picked up.
What Git Switch To Main does
Switch to the main branch and pull the latest changes.
Steps
- Check for uncommitted changes with
git status. If any exist, stop and warn the user — do not stash or discard automatically. - Switch to main:
git checkout main
- Pull the latest changes:
git pull origin main
- Confirm by showing the latest commit with
git log --oneline -1.
Alternatives in Git
- Ws Reset — Reset the current branch to main, fetch upstream, and update submodules 38.1k ★
- OSS PR — Commit + PR workflow for open source contributions: auto-creates a user-prefixed branch when on main/master, t 19.7k ★
- Maestro Merge — Merge session worktree branch back to main 530 ★
Full documentation available on GitHub
View Source RepositoryRelated Skills
Git Pull
Pull the latest changes from the remote for the current branch.
Clean After Merged
Switch to the repo's main branch, pull, and delete the just-merged local branch.
PR Merged
Post-merge cleanup — checkout main, pull latest, delete the feature branch, and close the linked work item.
Pull All
Pull latest changes in each submodule by changing into the directory and running git pull.
PR Template
Generate a pull request description for the current branch by analyzing all commits and changes since divergin
Reset Branch
Switch to main and delete previous branch
Related Agents
.github/workflows/ci Cd.yml
name: CI/CD Pipeline on: push: branches: [main, develop] pull_request: branches: [main] jobs: lint: runs-on: u
Yago
Use this agent when the user asks to write, create, or generate a pull request description, PR description, or
Git Flow Manager
Git Flow workflow manager. Use PROACTIVELY for Git Flow operations including branch creation, merging, validat