Git version control management for code commits, push operations, branch management, and maintaining git history records...
This skill provides tools and workflows for managing git operations in software development projects. It supports code commits, push operations, branch management, and git history maintenance.
When making code changes:
git statusgit add <file> or git add .git diff --cachedgit commit -m "Descriptive message"git push origin <branch>For feature development:
git checkout -b feature/new-featuregit checkout main or git checkout feature/new-featuregit merge feature/new-feature (when ready)git branch -d feature/old-featureTo understand project history:
git log --oneline --graph --allgit show <commit-hash>git diff main..feature/new-featuregit log --follow -p <file-path>For collaboration:
git remote -vgit fetch origingit pull origin maingit push origin <branch>git push -u origin <branch> (first push)# 1. Check status
git status
# 2. Stage all changes
git add .
# 3. Commit with message
git commit -m "feat: add new feature"
# 4. Push to remote
git push origin main
# 1. Create and switch to feature branch
git checkout -b feature/new-feature
# 2. Make changes and commit
git add .
git commit -m "feat: implement new feature"
# 3. Push feature branch
git push -u origin feature/new-feature
# 4. Merge to main (after review)
git checkout main
git pull origin main
git merge feature/new-feature
git push origin main
# Compact view with graph
git log --oneline --graph --all
# Show recent commits with details
git log -5 --stat
# Search commits by message
git log --grep="bugfix"
# View commits by date
git log --since="2024-01-01" --until="2024-12-31"
# Pull latest changes before pushing
git pull origin main --rebase
# Or force push (use with caution)
git push origin main --force
# Resolve conflicts in files marked by <<<<<<<
# After resolving:
git add .
git commit -m "fix: resolve merge conflicts"
# Undo last commit (keep changes)
git reset --soft HEAD~1
# Undo last commit (discard changes)
git reset --hard HEAD~1
# Stash changes
git stash
# Switch to correct branch
git checkout correct-branch
# Apply stashed changes
git stash pop
type(scope): descriptionmain: Production-ready codedevelop: Integration branchfeature/*: New featuresbugfix/*: Bug fixesrelease/*: Release preparationreferences/git-cheatsheet.md for common commandsreferences/commit-examples.md for good commit messagesreferences/branch-examples.md for branch management patternsexamples/youtube-sc/ for project-specific git workflowsUse this skill when: