noknow.dev
Sign inSign up
Course overview
Git — Complete Course
0 / 24 lessons0%

Git Basics

  • git init — Starting a Repository
  • git add + git commit — Your First Commit
  • git status + git log — Reading the State
  • git diff — Seeing What Changed
  • .gitignore — Ignoring Files

Branching

  • git branch + git switch — Working with Branches
  • git merge — Combining Branches
  • Resolving Merge Conflicts
  • Cleaning Up Branches

Remote Repositories

  • git remote — Connecting to a Remote
  • git push — Uploading Your Commits
  • git fetch + git pull — Getting Remote Changes
  • git clone — Copying a Repository

Undoing Changes

  • git restore — Discarding Uncommitted Changes
  • git reset — Moving HEAD Back
  • git revert — Safely Undoing a Commit
  • git stash — Temporarily Saving Work

Rewriting History

  • git commit --amend — Fixing the Last Commit
  • git rebase — Cleaner History
  • git cherry-pick — Applying Specific Commits

Advanced Tools and Workflows

  • git tag — Marking Releases
  • Mastering git log
  • git bisect — Finding Bugs with Binary Search
  • Professional Git Workflows

Cleaning Up Branches

0m 00s

Keeping Your Branch List Tidy

After merging a feature, the branch is done — delete it to avoid clutter:

git branch -d feature      # delete (safe — refuses if unmerged)
git branch -D feature      # force delete (even if unmerged)

git branch                 # list local branches
git branch -a              # list local AND remote branches
git branch -r              # list remote-tracking branches only

Renaming a branch

git branch -m old-name new-name   # rename
git branch -m new-name            # rename current branch

Viewing merged/unmerged branches

git branch --merged          # safe to delete
git branch --no-merged       # still has unmerged work

Your Task

You have two branches: done (already merged) and wip (work in progress). Delete done safely with -d and rename wip to in-progress.

Back
bashCtrl+Enter to run
Output

Click "Run" to execute your code.