DEV Community

niuniu
niuniu

Posted on

Quick Tip: Git Branching Strategies

Quick Tip

Git branching strategies:

Feature Branch Workflow

# Create feature branch
git checkout -b feature/new-feature

# Make changes and commit
git add .
git commit -m "Add new feature"

# Push to remote
git push origin feature/new-feature

# Merge to main
git checkout main
git merge feature/new-feature
Enter fullscreen mode Exit fullscreen mode

Git Flow

# Main branches
main        # Production code
develop     # Development code

# Supporting branches
feature/*   # New features
release/*   # Release preparation
hotfix/*    # Production fixes
Enter fullscreen mode Exit fullscreen mode

Powered by MonkeyCode: https://monkeycode-ai.net/

git #devops #tips

Top comments (0)