npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

git-local-prune

v1.0.3

Published

git locale prune gone branches on remote

Downloads

253

Readme

git-local-prune

A git tool to clean the local branches that are deleted [gone] on remote

Install

You can install git-local-prune using one of the options listed below

| Source | Command | | -------- | ------------------------------------------------------------------------------------------------------------------------ | | curl | curl -L https://raw.githubusercontent.com/MathieuDoyon/git-local-prune/master/installer.sh \| sudo sh | | npm | npm install -g git-local-prune | | manual | Clone and run make install | | git-bash | For Windows : curl -L https://raw.githubusercontent.com/MathieuDoyon/git-local-prune/master/windows-installer.sh \| sh |

Usage

Simply run it in your project directory and it will give you the output from the branches prune locally

git local-prune

If you run it in a folder containing multiple git repositories, it will go through each of the projects and give you the local-prune report for each one of them.

Options

You can pass several options to modify how git-local-prune behaves

git local-prune [-m <max-dir-depth>]
            [-f]
            [-F]
            [-r]
            [-L]
            [-h]

git local-prune [-m ] [-f] [-F] [-r] [-F] [-L] [-h]

Here is the detail for each of the options

| Option | Description | | ------ | ------------------------------------------------------------------------------------------- | | m | Specify the depth of recursive directory search e.g. -m 3 defaults to two | | f | Fetch the latest commits beforehand | | F | Force recursion up to specified depth even when git repository found earlier | | L | Toggle inclusion of symbolic links in recursive directory search | | h | Display the help screen | | r | Generates the local-prune report file git-local-prune-report.txt in the current directory |

For the basic usage, all you have to do is run git local-prune in a repository or a folder containing multiple repositories

Single Repository Usage

To check all your local branches to prune from your last git fetch, head to the project repository and run

$ git local-prune

Directory depth

By default the script searches only in the current directory or one level deep. If you want to increase that, use the -m switch. If the base directory is a git repository you can use the -F switch to force the recursion.

$ git local-prune -m 3

Directory whitelisting

If you want to restrict the local-prune to some paths, you can whitelist them by adding them to a .git-local-prune-whitelist file. For example if you have the below directory structure

├── Workspace              # All your projects are here
│   ├── project-a          # Some git repository called project-a
│   ├── project-b          # Some git repository called project-b
│   ├── sketch-files       # Some sketch files
│   ├── mockups            # Some balsamiq mockups
│   └── ...                # etc.
└── ...

And you want the git-local-prune to show logs for only project-a and project-b, you can do that by creating a .git-local-prune-whitelist file under the Workspace directory with the below contents and it will only consider these directories for the local-prune

project-a
project-b

Fetch gone branches before showing local-prune

If you have many repositories that you want to generate a local-prune for, it may be useful to automatically run git fetch before viewing the local-prune.

If you would like to automatically run git fetch --all before printing the local-prune, you can add the -f flag, as show below

$ git local-prune -f

Mixing options

Of course you can mix the options together.

# Fetch branches before each local-prune command with a max depth of 5 directories
$ git local-prune -m 5 -r -f

License

MIT © Mathieu Doyon