Git & GitHub Interview Question #135

What is GitHub Flow?

Security, Team Workflows, Troubleshooting & Senior Git/GitHub Scenarios Senior Advanced

Quick Interview Answer

GitHub Flow is a lightweight branch-based workflow commonly centered on a deployable main branch. Work is performed on a descriptive branch, pushed to GitHub, reviewed through a pull request, validated, merged, and then deployed according to the project's process.

Detailed Explanation

GitHub Flow is a lightweight branch-based workflow commonly centered on a deployable main branch. Work is performed on a descriptive branch, pushed to GitHub, reviewed through a pull request, validated, merged, and then deployed according to the project's process.

It suits teams that integrate and deploy frequently. Projects with multiple maintained release lines or stricter release phases may need additional branching conventions.

Code Example

git switch main
git pull --ff-only
git switch -c fix/profile-image

# Work, commit, and publish
git add .
git commit -m "Fix profile image"
git push -u origin fix/profile-image

# Open pull request -> review -> merge