Skip to main content
Practice Problems

Git branching strategies (Git Flow, GitHub Flow)?

1. Git Flow

Complex, for scheduled releases.

``` main (production) develop (integration) feature/* (new features) release/* (release prep) hotfix/* (urgent fixes) ```

Pros: Structured, clear roles Cons: Complex, slow

2. GitHub Flow

Simple, for continuous deployment.

``` main (always deployable) feature/* (short-lived) ```

Workflow:

  1. Create feature branch
  2. Commit changes
  3. Open Pull Request
  4. Review & merge
  5. Deploy main

Pros: Simple, fast Cons: Requires good CI/CD

3. Trunk-Based Development

Very short-lived branches.

```bash

git checkout -b feature/quick-fix

git checkout main git merge feature/quick-fix ```

Pros: Continuous integration Cons: Requires discipline

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.

Finished reading?
Practice Problems