| name | git_workflow |
| description | Git workflow and version control operations |
| version | 1.0.0 |
| tags | ["git","version-control","workflow"] |
Git Workflow Skill
Version control operations and Git workflow management.
When to Use
Use this skill when you need to:
- Create and manage branches
- Commit changes with proper messages
- Handle merges and resolve conflicts
- Work with remotes and pull requests
- Understand git history and blame
Common Operations
Branching
git checkout -b feature/name
git branch -a
git branch -d feature/name
git push origin --delete feature/name
Committing
git add file.py
git add .
git commit -m "feat: add new feature"
git commit --amend
Merging
git merge feature/name
git rebase main
git merge --abort
git rebase --abort
History
git log --oneline --graph --all
git log --follow file.py
git blame file.py
git show <commit-hash>
Remotes
git push -u origin feature/name
git pull --rebase
git fetch --all
git remote -v
Workflows
Feature Branch Workflow
- Create branch from main
- Make commits
- Push to remote
- Create pull request
- Review and merge
- Delete branch
Gitflow Workflow
- main (production) - releases only
- develop (integration) - feature branches
- feature/* - new features
- release/* - release preparation
- hotfix/* - emergency fixes
Trunk-Based Development
- All work happens on main
- Use feature flags for unreleased features
- Short-lived branches (<1 day)
- Continuous integration
Conflict Resolution
When conflicts occur:
-
Identify Conflict Files
git status
-
Edit Files
- Look for
<<<<<<<, =======, >>>>>>>
- Choose which version to keep
- Remove conflict markers
-
Mark Resolved
git add <resolved-file>
-
Complete Merge
git commit
Best Practices
- Write clear, descriptive commit messages
- Keep commits atomic (one logical change)
- Pull before pushing
- Use
.gitignore properly
- Never commit secrets or API keys
- Review changes before committing
- Use branches for all work
- Keep history clean (avoid merge commits)