Skip to content
    SeaCode
    Learning tracksCode ArenaWorkshops & EventsInstructors
    Log inSign up
    GITGit & GitHub

    Basics: from file to commit

    • Why version control?
    • From working tree to commit
    • Read history and differences
    • .gitignore and useful commit messages

    Branches and merging

    • Branches and HEAD
    • Merge: fast-forward and three-way
    • Resolve merge conflicts
    • Park work temporarily with stash

    Undo without losing work

    • Restore and unstage
    • Reset: soft, mixed and hard
    • Revert or reset?
    • Amend and reflog: rescue recent work

    Remotes and GitHub Flow

    • Remotes, push and tracking
    • Fetch, pull and rejected pushes
    • GitHub Flow: complete project
    Git & GitHub

    Remotes and GitHub Flow · Lesson 15 of 15

    GitHub Flow: complete project

    Turn an issue into a branch, commits, a pull request, review and a deployable merge.

    14 minutes2 games

    GitHub Flow is simple: main stays deployable. For each change, create a short-lived branch, make clear commits, push and open a pull request. A PR is a place for discussion, CI and review—not merely a merge button. Merge after approval and tests, then delete the branch name.

    Small clear issue

    Feature branch

    Commits + tests

    Pull request + review

    Merge and deploy

    Git
    git init -q -b main
    echo "# Tasks" > README.md
    git add README.md
    git commit -q -m "Start project"
    git switch -q -c feature/add-help
    echo "Use: node app.js" >> README.md
    git commit -q -am "Document app usage"
    git switch -q main
    git merge -q --no-ff feature/add-help -m "Merge help documentation"
    git log --format=%s

    Without write access, create a fork, push to it, and open a PR against the upstream repository. Before review, keep the PR small and explain its purpose, test method and risks. Address review with clear commits rather than hiding the discussion.

    Terminal
    # Real GitHub CLI workflow (shown, not run in the simulator)
    git push -u origin feature/add-help
    gh pr create --fill
    gh pr checks --watch
    gh pr merge --squash --delete-branch

    Important

    No workflow replaces tests and review. Protected main, required checks and another reviewer reduce mistakes, but the team must still understand the change. Giant PRs are harder to review and riskier to merge.

    Quick question

    When should you open a pull request?

    Interview question

    Merge, squash or rebase for a PR?

    Exercise

    Run a local workflow: Base on main, Add feature on a branch, merge with --no-ff as Merge feature, then print history.

    Expected output:
    Merge feature
    Add feature
    Base
    Git
    git init -q -b main
    echo "base" > app.txt
    git add app.txt
    git commit -q -m "Base"
    git log --format=%s

    Learn more from

    • GitHub Docs: GitHub flowdocs.github.com
    • Git: gitworkflowsgit-scm.com

    Played 0 of 2 games

    Sign in to save your progress and earn XP.

    PreviousFetch, pull and rejected pushes🎉 خلّصت Git & GitHub!
    SeaCode

    Learn to code for real, online or at our branch in front of Cairo University, Giza.

    Learn

    • All courses
    • Interactive tutorials
    • Interview practice problems
    • Mock interview
    • Learning tracks
    • Code Arena
    • Workshops & Events
    • Knowledge library
    • Team projects

    Your account

    • Log in
    • Sign up
    • Learning plan
    • Certificates
    • Site map

    Contact us

    • WhatsApp
    • 010 9094 1104
    • In front of Cairo University, Giza

    © 2026 SeaCode. All rights reserved.