
Research
/Security News
Miasma Mini Shai-Hulud Hits ImmobiliareLabs npm Packages
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.
Quickly reset your Git working directory to a clean state without re-cloning. Stashes, wipes, restores, and pops.
Quickly reset your Git working directory to a clean state without re-cloning. Stashes, wipes, restores, and pops.
Many developers have the habit of deleting their entire project and running git clone again when they encounter issues with their working directory. This is unnecessary and time-consuming! Instead, git-fresh performs the following operations:
.git directoryThis achieves the same result as re-cloning but much faster and without losing your Git history or remotes.
You can run git-fresh directly using npx without installing it globally:
npx git-fresh
Or with other package managers:
# Using pnpm
pnpm dlx git-fresh
# Using yarn
yarn dlx git-fresh
# Using bun
bunx git-fresh
Or install it globally:
npm install -g git-fresh
# or with bun
bun add -g git-fresh
# or with pnpm
pnpm add -g git-fresh
# or with yarn
yarn global add git-fresh
Simply run the command in any Git repository:
npx git-fresh
Or if installed globally:
git-fresh
You can use various options to customize the behavior of git-fresh:
--ignore-env-filesProtects environment files from being removed during the reset process. This includes files matching patterns like .env, .env.*, *.env, and .*.env.
npx git-fresh --ignore-env-files
When this option is used, you'll be prompted to choose which environment files to protect, unless you also use --skip-confirmation.
--skip-confirmationWhen used with --ignore-env-files, this option skips the interactive confirmation and automatically protects all detected environment files.
npx git-fresh --ignore-env-files --skip-confirmation
--ignore-glob-files <pattern>Protects files matching the specified glob pattern from being removed during the reset process. This is useful for protecting specific files or file types that you want to keep.
# Protect all .config files
npx git-fresh --ignore-glob-files "*.config"
# Protect all files in a specific directory
npx git-fresh --ignore-glob-files "temp/**"
# Protect files with specific extensions
npx git-fresh --ignore-glob-files "**/*.{log,tmp}"
You can combine multiple options as needed:
# Protect both env files and custom glob pattern
npx git-fresh --ignore-env-files --ignore-glob-files "*.local" --skip-confirmation
The tool will output progress information as it performs each step:
🚀 Git Fresh - Resetting working directory
✓ Changes stashed successfully
✓ Files removed successfully
✓ Files restored successfully
✓ Stashed changes applied successfully
🎉 Git working directory reset successfully!
$ npx git-fresh
🚀 Git Fresh - Resetting working directory
ℹ No changes to stash
✓ Files removed successfully
✓ Files restored successfully
🎉 Git working directory reset successfully!
$ npx git-fresh
🚀 Git Fresh - Resetting working directory
✓ Changes stashed successfully
✓ Files removed successfully
✓ Files restored successfully
✓ Stashed changes applied successfully
🎉 Git working directory reset successfully!
$ npx git-fresh
🚀 Git Fresh - Resetting working directory
✓ Changes stashed successfully
✓ Files removed successfully
✓ Files restored successfully
⚠ Could not apply stashed changes (conflicts may exist)
Run "git stash list" to see your stashed changes
🎉 Git working directory reset successfully!
Before running git-fresh:
README.md, src/index.jstemp.txt, debug.logold-file.js (was in git)After running git-fresh:
.git.git directory is never touchedThis project uses Bun for package management:
# Install dependencies
bun install
# Build the project
bun run build
# Validate the package is ready
bun run validate
To test the package locally before publishing:
bun run build/path/to/git-fresh/dist/cli.jsTo publish the package to npm:
# Build and validate
bun run validate
# Publish (requires npm account and authentication)
npm publish
Leynier Gutiérrez González
MIT
FAQs
Quickly reset your Git working directory to a clean state without re-cloning. Stashes, wipes, restores, and pops.
The npm package git-fresh receives a total of 16 weekly downloads. As such, git-fresh popularity was classified as not popular.
We found that git-fresh demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.

Security News
Rolldown paused Rust React Compiler integration after a 5MB binary size increase raised concerns about shipping React-specific code to all Vite users.

Security News
/Research
Mini Shai-Hulud expands into the Go ecosystem after hitting LeoPlatform npm packages and targeting GitHub Actions workflows.