git-clear
Reset and clean working directory
TLDR
SYNOPSIS
git clear [options]
DESCRIPTION
git clear is a git-extras command that combines git clean -d -f -x and git reset --hard into a single convenience command. It removes all uncommitted changes, tracked and untracked, including files matched by .gitignore, returning the repository to a pristine state matching HEAD.This is the most aggressive of the git-extras clearing commands: git reset --hard alone only touches tracked files, and git-clear-soft spares ignored files, but git clear wipes everything not committed. By default it asks "Sure? - This command may delete files that cannot be recovered, including those in .gitignore [y/N]:" before proceeding.The operation is destructive and cannot be undone, as it permanently deletes uncommitted work. The -f flag bypasses the confirmation prompt, allowing automated scripts to clean repositories without user interaction. Use with caution in repositories containing valuable uncommitted work or ignored build artifacts you meant to keep.
PARAMETERS
-f, --force
Force without confirmation.
INSTALL
CAVEATS
Irreversibly deletes untracked and ignored files alongside the hard reset; there is no undo. Requires git-extras to be installed.
SEE ALSO
git-clear-soft(1), git-reset(1), git-clean(1), git-extras(1)
