Quiz: How does 'git reset --hard' differ fundamentally from 'git reset --soft'?
--hard discards all uncommitted modifications across the index and working directory, restoring exact commit state.
Find tutorials, system documentation, dynamic pages, and interactive quizzes in one place.
--hard discards all uncommitted modifications across the index and working directory, restoring exact commit state.
The reflog keeps a chronological journal of all HEAD pointer movements, enabling rescue of orphaned commits or lost branches.
The .gitignore file lists file patterns (such as build artifacts, cache files, and secrets) that Git will not track.
git commit --amend replaces the most recent commit on the active branch with a new commit incorporating staged changes.
git diff --staged displays the exact code changes that have been added to the staging index ready for the next commit.
git config --global configures user identity in ~/.gitconfig , attributing future commits to that author.
git rm --cached stops tracking the file in Git version control while leaving the physical file untouched in the workspace.
git submodule update --init --recursive registers, clones, and checks out all nested git submodules configured in .gitmodules .