git
Git version control system
Why does your Git pull request show hundreds of unexpected file changes after adding one file? Learn about merge-base issues, line endings (CRLF/LF), and fixes like rebasing, fresh branches, or .gitattributes normalization for safe merges.
Why Git forbids --detach with --orphan, how to detach HEAD by using git checkout on an orphan commit SHA, and scripting patterns to handle orphan branches.
Discover how developers conducted code reviews before GitHub using Git patches emailed to mailing lists. Learn the git format-patch, git send-email workflow that powered Linux kernel development with offline testing and inline feedback.
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.
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.
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.
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.
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.