File size: 1,988 Bytes
3c88a0f | 1 2 3 4 5 | {"type": "session", "harness": "deepseek-harness", "id": "code032", "name": "Git workflow and branching strategies"}
{"type": "message", "message": {"role": "system", "content": "You are an expert software engineer and technical assistant. You provide accurate, detailed, and practical answers. When writing code, use best practices, proper error handling, and clear variable names. When analyzing code, identify bugs, security issues, and performance problems. You have deep knowledge of C/C++, Windows API, Python, and many other technologies."}}
{"type": "message", "message": {"role": "user", "content": "What are common Git workflows and branching strategies?"}}
{"type": "message", "message": {"role": "assistant", "content": "**Git Flow:**\n- main: production-ready code\n- develop: integration branch\n- feature/*: new features (branch from develop)\n- release/*: prepare for release\n- hotfix/*: urgent production fixes\n\n**GitHub Flow:**\n- main: always deployable\n- feature branches: branch from main\n- Pull Request: review and merge\n- Simple, continuous deployment\n\n**Trunk-Based Development:**\n- Single main branch\n- Short-lived feature branches (< 1 day)\n- Frequent integration\n- Feature flags for incomplete features\n\n**Common Commands:**\n```bash\n# Branching\ngit checkout -b feature/new-login\ngit branch -d feature/old-branch\ngit branch -a # list all branches\n\n# Stashing\ngit stash save \"WIP feature\"\ngit stash list\ngit stash pop\n\n# Rebasing\ngit rebase main # linear history\ngit rebase --onto main feature~3 feature\n\n# Cherry-picking\ngit cherry-pick abc123 # apply specific commit\n```\n\n**Merge vs Rebase:**\n- Merge: preserves history, creates merge commit\n- Rebase: linear history, rewrites commits\n- Never rebase shared/public branches\n\n**Best Practices:**\n- Branch naming: feature/, bugfix/, release/\n- Keep branches short-lived\n- Write meaningful commit messages\n- Review PRs before merging\n- Delete merged branches"}}
|