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

Professional Git Workflows

0m 00s

How Real Teams Use Git

Feature Branch Workflow

The most common approach: every new feature or fix gets its own branch.

git switch -c feature/user-auth    # descriptive branch name
# ... develop ...
git push -u origin feature/user-auth
# Open a Pull Request / Merge Request on GitHub/GitLab
# Get code review
git switch main && git pull        # get merged changes

Conventional Commits

Structured commit messages help automation (changelogs, semantic versioning):

feat: add user authentication
fix: correct email validation regex
docs: update API reference
refactor: extract auth into separate module
test: add unit tests for login flow
chore: upgrade dependencies

Good commit hygiene

  • Atomic commits — one logical change per commit
  • Present tense — "Add feature" not "Added feature"
  • 70-char subject — fits in git log --oneline
  • Blank line + body — explain why, not what
  • Never commit secrets, credentials, or large binaries

Your Task

Simulate the full feature branch workflow: create a branch feature/greeting, add greeting.txt, commit with a conventional commit message starting with feat:, then merge back to main and delete the feature branch.

Back
bashCtrl+Enter to run
Output

Click "Run" to execute your code.