git
Git version control system and its operations
Use git clean to remove local untracked files from your Git working tree safely. Learn git clean -n for dry run, -f to force delete, -fd for directories, and -x for ignored files. Essential Git cleanup guide with flags and tips.
Learn to view Git stash contents without applying using git stash list for inventory, git stash show for summaries, and git stash show -p for full diffs. Safe inspection of changes, untracked files, and advanced tips for Git workflows.
Learn to use git add -p for partial commits in Git. Stage only specific lines like 15 out of 30 changes, verify with git diff --staged, and commit cleanly. Perfect for atomic git commits and better code reviews.
Learn how to view complete Git file history including content changes using git log -p -- file, git show for specific commits, and git diff tools. See exact diffs, patches, and file snapshots in each commit.
Easily undo a git rebase with multiple commits using git reflog to find the pre-rebase state and git reset --hard to recover your branch. Skip manual cherry-picking for fast, error-free recovery.
Reset your local Git branch to exactly match the remote repository using git fetch origin, git reset --hard origin/branch, and git clean -fdx. Discard all local changes safely with step-by-step guide and backups.
Create a local branch (git branch or git checkout -b), then push and set tracking with git push -u origin <branch>. Verify with git branch -vv. Check tracking.
Locate the original Git clone URL for a local repo. Run git remote -v or git remote get-url, or view .git/config to find origin, upstream, and GitHub parent.
Step-by-step guide to delete a Git branch both locally and remotely. Use git push origin --delete, git branch -d bugfix, and git fetch --prune to remove branches and prevent reappearing after git pull. Fix common errors.
Use git remote set-url to repoint origin from USB to NAS without losing history. Verify with git remote -v and git fetch; reconcile any divergent commits.
Recover a dropped git stash: find its hash via git stash pop output, git fsck or reflog; inspect with git show/gitk, then apply or recreate the stash ref.
Learn how to resolve merge conflicts in Git step-by-step. Use git status to spot issues, edit files to remove markers, git add resolved files, and commit. Tips for git mergetool, aborting merges, and prevention.
Learn how to revert a Git repository to a previous commit like 0d1d7fc using git reset --hard or git revert commit. Safe methods for local and shared branches, with examples, recovery tips, and git reset head alternatives.
Learn how to undo the most recent local commits in Git using git reset (--soft, --mixed, --hard) or git revert. Step-by-step fixes for wrong files, recovery with reflog, and when to avoid rewriting history. No push needed.
Learn how to resolve Git 'would clobber existing tag' error when pulling tags. Discover safe solutions beyond force-pulling or recloning your repository.
Resolve 'Warning: Remote Host Identification Has Changed!' error in GitHub SSH from 2023 RSA key update. Step-by-step fix: ssh-keygen -R github.com, ssh-keyscan to add new keys, verify with ssh -T git@github.com for git push/clone.
Resolve 'fatal: remote origin already exists' Git error when adding origin to GitHub repo. Check remotes with git remote -v, remove or set-url origin for Rails tutorials and pushes. Step-by-step fixes.
Learn how to completely remove Git commit history in GitHub while preserving your current code state. Step-by-step guides using orphan branches, git filter-branch, and repository re-initialization.
Create a Git commit with a separate title and body from the CLI. Use multiple -m flags, -F file input, or commit templates for consistent commit messages.
Understand the key differences in Git between HEAD (pointer to current commit), working tree (editable files on disk), and index/staging area (snapshot for next commit). Learn workflow, commands like git status, git add, and common confusions like detached HEAD.