source-control

Git conventions for commit messages and workflow. Use for git commit, conventional commits, branch strategy, rebasing, merge conflicts, git workflow. Not for general code changes that happen to need a commit afterward.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "source-control" with this command: npx skills add maroffo/claude-forge/maroffo-claude-forge-source-control

ABOUTME: Git conventional commit format and version control best practices

ABOUTME: Commit message standards, branch strategies, workflow patterns

Source Control

Quick Reference

git commit -m "feat: add user authentication"
git checkout -b feat/user-auth
git fetch origin && git rebase origin/main
git stash && git stash pop

Conventional Commits

Format: <type>(<scope>): <subject> (scope/body/footer optional)

TypeUse
featNew feature
fixBug fix
docsDocumentation
styleFormatting
refactorCode restructure
perfPerformance
testTests
choreMaintenance
ciCI/CD
buildBuild system
revertRevert commit

Rules: Imperative mood, present tense, lowercase, no period, max 50 chars

# Good
git commit -m "feat(auth): add JWT validation"
git commit -m "fix: resolve race condition"

# Bad
git commit -m "Fixed stuff"      # Not conventional
git commit -m "Feat: Add thing"  # Capital letter

Commit Process

  1. Check state:

    git status && git diff HEAD && git branch --show-current && git log --oneline -5
    
  2. Verify NOT on main/master (abort if so, unless authorized)

  3. Stage specific files (never git add -A):

    git add <specific-files>
    
  4. Commit with conventional format:

    git commit -m "<type>(<scope>): <subject>"
    

Branch Naming

TypePattern
Featurefeat/user-auth, feature/dashboard
Fixfix/login-bug, bugfix/api-error
Hotfixhotfix/security-patch
Chorechore/update-deps

Workflow

# Start feature
git checkout main && git pull origin main
git checkout -b feat/user-auth

# Keep up to date
git fetch origin && git rebase origin/main

# After PR merged
git checkout main && git pull
git branch -d feat/user-auth
UseWhen
RebaseKeep feature branch current, clean linear history
MergeIntegrate to main (via PR), preserve history

Recovery

SituationCommand
Undo last commit (keep changes)git reset --soft HEAD~1
Undo staged filesgit reset HEAD <file>
Discard file changesgit checkout -- <file>
Recover deleted branchgit reflog then git checkout -b <branch> <sha>
Amend last commitgit commit --amend -m "new message"
Revert pushed commitgit revert <sha>

Conflicts

Resolve: git status to see conflicts, edit files to remove markers, git add <resolved>, then git rebase --continue (or git merge --continue). Use git rebase --abort to bail out.


Hooks

Pre-commit: .git/hooks/pre-commit -- run linters, formatters, tests per language.

Commit-msg: Validate conventional format (commitlint, husky, lefthook).


Best Practices

DODON'T
Conventional commitsGeneric messages ("fix", "update")
Small, logical commitsHuge unrelated changes
Run tests before commitPush broken code
Use branchesCommit to main directly
--force-with-lease--force on shared branches

Resources

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

clickup

No summary provided by upstream source.

Repository SourceNeeds Review
General

newsletter-digest

No summary provided by upstream source.

Repository SourceNeeds Review
General

rails

No summary provided by upstream source.

Repository SourceNeeds Review