LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

git-clear

Reset and clean working directory

TLDR

Clear working directory
$ git clear
copy
Clear with force
$ git clear -f
copy

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

sudo apt install git
copy
sudo dnf install git
copy
sudo pacman -S git
copy
sudo apk add git
copy
sudo zypper install git
copy
brew install git
copy
nix profile install nixpkgs#git
copy

CAVEATS

Irreversibly deletes untracked and ignored files alongside the hard reset; there is no undo. Requires git-extras to be installed.

SEE ALSO

RESOURCES

Braincup
Open source brain training for math, memory and focus
Braincup mini-games
41 mini-games · Apache-2.0
No ads · No tracking
Play in browser
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid
276 stars
From the maker of Linux Command Library
Copied to clipboard
Braincup
Open source brain training for math, memory and focus. 41 mini-games, from mental arithmetic to Sudoku, N-Back and Solo Chess.
Apache-2.0 licensed · No ads · No tracking · No account
From the maker of Linux Command Library
Download Braincup on the App StoreGet Braincup on Google PlayGet Braincup on F-Droid