git-clear-soft
Unstage changes, keep working directory
TLDR
Reset all tracked files and delete all untracked files
SYNOPSIS
git clear-soft [-n|--dry-run] [-i|--interactive] [-d <directory>|--temp-dir <directory>] [--stash] [--ignore] [--reset-local]
PARAMETERS
-n|--dry-run
Performs a dry run, showing what would be cleared or acted upon without actually performing the action.
-i|--interactive
Enables interactive mode, prompting the user before each potential action.
-d <directory>|--temp-dir <directory>
Moves untracked files to the specified directory instead of deleting them.
--stash
Stashes current uncommitted changes (both staged and unstaged) into the Git stash.
--ignore
Adds untracked files to the project's .gitignore file, preventing them from being tracked in the future.
--reset-local
Resets unstaged changes in the working directory, similar to git restore --staged or git restore <file>, effectively undoing staging or local modifications without data loss.
DESCRIPTION
The git-clear-soft command is not a standard Git command. It is a hypothetical or user-defined script/alias intended to provide a 'soft' method for handling untracked files or unstaged changes within a Git repository. Unlike `git clean -f`, which permanently deletes untracked files, git-clear-soft aims to manage these items without destruction.
Potential 'soft' actions could include:
- Moving untracked files to a temporary directory.
- Stashing local modifications (both staged and unstaged).
- Adding untracked files to the project's .gitignore file to prevent future tracking.
- Performing a soft reset to unstage changes without losing them.
The exact behavior of git-clear-soft would depend entirely on its implementation, typically as a custom shell script or Git alias defined by a user or project.
CAVEATS
The git-clear-soft command is not a built-in or standard Git command. Its existence and behavior are entirely dependent on it being a user-defined alias, a custom shell script, or a third-party utility. Users should verify its implementation if they encounter it in a shared environment, as its functionality can vary greatly. There is no official manual page or universal specification for this command.
TYPICAL IMPLEMENTATION
This command would typically be implemented as a shell script placed in the user's PATH (e.g., ~/bin/git-clear-soft) or as a Git alias configured in the Git configuration file (e.g., ~/.gitconfig or .git/config). An example alias could be: git config alias.clear-soft '!f() { git stash --include-untracked && git clean -dn && echo "Untracked files and changes safely handled."; }; f'
HISTORY
As git-clear-soft is not a standard command, it has no official development history. Any 'history' would pertain to its individual creation and usage within specific projects or user environments as a custom solution to manage untracked files and local changes non-destructively, often as an alternative to the more aggressive `git clean` command.
SEE ALSO
git clean(1), git stash(1), git reset(1), git restore(1), git add(1), gitignore(5)