local Subscribe

Labs/DevOps/Git Basics

Git Basics

Record history, work on branches, merge, and undo mistakes - using the real git CLI.

  1. Your first commitinit, add, commit and log - the core Git loop. · 10 min · beginner
  2. Branches and mergingWork on a feature in isolation, then merge it back into main. · 12 min · intermediate
  3. Undoing mistakesDiscard edits, unstage files, and revert a bad commit safely. · 12 min · intermediate
  4. Ignoring files with .gitignoreUse .gitignore to keep temporary, generated, and environment-specific files out of Git. · 10 min · beginner
  5. Stashing uncommitted work in GitSave uncommitted work, switch branches for a hotfix, and restore with Git Stash. · 10 min · intermediate
  6. Resolve merge conflicts safelyResolve a real Git conflict, keep both changes, and finish a merge without losing history. · 15 min · intermediate
  7. Rebase and cherry-pickReplay a branch onto a newer main, copy one commit across branches, and squash WIP commits. · 15 min · intermediate