New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

git-filter

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

git-filter

Create a filtered copy of a git repo with full commit history preserved

latest
Source
npmnpm
Version
2.4.0
Version published
Weekly downloads
4
100%
Maintainers
1
Weekly downloads
 
Created
Source

git-filter

Create a filtered copy of a git repository - keeping only the files you choose, with full commit history preserved.

Useful for publishing parts of a private repository as open source.

Install

npm install -g git-filter

Or run directly:

npx git-filter config.json

Usage

Create a config.json:

{
  "forceReCreateRepo": true,
  "sourceRepoPath": ".",
  "targetRepoPath": "../my-public-repo",
  "allowedPaths": ["packages/frontend/*", "README.md"],
  "ignoredPaths": ["packages/frontend/.env"]
}

Run it:

git-filter config.json

A new git repo appears at targetRepoPath with only the matching files - every commit, author, and date intact.

Used by

  • MemoCard - Telegram mini app for improving memory with spaced repetition
  • Nomad Expense - Family expense tracker as a Telegram mini app
  • Just Block - A Chrome extension to quickly block distracting websites

Acknowledgements

Fork of open-condo-software/gitexporter with nodegit (native C++ addon, unmaintained, won't compile on Node 18+) replaced by plain git CLI calls. Zero native dependencies, works on any Node version.

FAQs

Package last updated on 09 Mar 2026

Did you know?

Socket

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.

Install

Related posts