Skip to content

Posts

Git Basics: Working on Two Branches with Worktrees

A worktree gives another branch its own directory. You can leave unfinished changes in one directory and work on another branch without stashing them. Run these commands in Bash …

Read more →

October 10, 2026

Git Basics: Saving and Applying a Patch File

A patch file stores a textual diff that you can inspect and apply later. This example saves an unstaged edit, returns the file to its committed state, then applies the saved patch. …

Read more →

October 10, 2026

Git Basics: Recovering a Detached Commit with Reflog

A reflog records local updates to references such as HEAD. It can help find a commit you made and then left behind without putting it on a branch. Run these commands in Bash with …

Read more →

October 10, 2026

Git Basics: Finding a Broken Commit with Bisect

When an older version works and the current version fails, git bisect narrows down the first bad commit. Give Git a repeatable test and known good and bad endpoints. Run these …

Read more →

October 10, 2026

Git Basics: Copying One Commit with Cherry-Pick

Cherry-pick applies the change from one existing commit to your current branch. It is useful when you need a specific fix without merging an entire branch. Run these commands in …

Read more →

October 10, 2026

Git Basics: Saving Unfinished Work with Stash

A stash temporarily sets aside local edits so you can return to a clean working tree. Practice saving and restoring one tracked file before using it during an interruption. Run …

Read more →

October 9, 2026

Git Basics: Resolving a Merge Conflict

When two branches change the same line differently, Git may need you to decide the final contents. This exercise creates a small conflict, resolves it, and records a merge commit. …

Read more →

October 9, 2026

Git Basics: Practicing Fetch Pull and Push Locally

A remote can be another directory on your computer. Use a local bare repository to practice sharing commits without an account, network connection, or changes to a real project. …

Read more →

October 9, 2026

Git Basics: Marking a Version with an Annotated Tag

A tag gives a particular commit a memorable name. An annotated tag also stores a message and tagger information, making it useful for a version you want to identify later. Run …

Read more →

October 9, 2026

Git Basics: Ignoring Generated Files

A build directory or local log usually does not belong in a commit. A project’s .gitignore records patterns for files Git should leave untracked. Run these commands in Bash with …

Read more →

October 9, 2026