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-snapshot

v2.2.2

Published

Take a snapshot of the directory - like 'git subtree split --squash'

Downloads

58

Readme

git-snapshot

git-snapshot is a tool to take a snapshot of the directory and creates/updates another branch, like git subtree split --squash.

npm npm (beta) license downloads release semantic-release

Summary

git-snapshot is a tool to take a snapshot of the directory and creates/updates another branch, like git subtree split --squash.

  • git-snapshot is a sub-command of git
  • Take a snapshot of the directory as a commit
  • Simple and fast
  • Unlike git subtree split, you can split from the directory in which you want

To take a snapshot, subtree split vs snapshot

|subtree split|snapshot| |--|--| |git subtree split --rejoin --prefix=path/to/target snapshot|git snapshot --prefix=path/to/target --branch=snapshot| |:+1: Official command- Contain all history:-1: Long commit log:-1: No squash option:-1: No support for moving target directory|- No history:+1: Short commit log:+1: Fast operation:+1: Any target directory| |||

Installation

Global installation

Install globally (add to your PATH) and you can use git-snapshot as a git sub-command.

$ npm install -g git-snapshot 

Local installation

For Node modules projects we recommend installing git-snapshot locally.

$ npm install --save git-snapshot 

Usage

CLI Usage

usage: git snapshot --prefix=<path> --branch=<branch> --message=<message>
[--tag=<tag>] [--remote=<repository>] [--dry-run] [--cwd=<path>]

Required
  --branch, -b   the name of branch for split to                 [string] [required]

Options:
  --help, -h     Show help                                                 [boolean]
  --version, -v  Show version                                              [boolean]
  --prefix, -p   the name of the subdir to split out                        [string]
  --message, -m  commit message                                             [string]
  --author, -a   override the commit author                                 [string]
  --force, -f    allow force commit, tag, push                             [boolean]
  --tag, -t      tag name                                                   [string]
  --remote, -r   remote repository                                          [string]
  --dry-run, -d  skip publishing                                           [boolean]
  --debug        output debugging information                              [boolean]
  --cwd, -c      working directory                                          [string]

Code Usage

const gitSnapshot = require('git-snapshot')

// Options are the same as command line, except camelCase
// gitSnapshot returns a Promise
gitSnapshot({
  prefix: './Packages/SomePackage',
  branch: 'upm',
  message: 'Release 1.0.0',
  author: 'snapshot',
  force: false,
  tag: '1.0.0',
  remote: 'origin',
  dryRun: false,
  cwd: process.cwd(),
}).then(() => {
  // git-snapshot is done
}).catch(err => {
    console.error(`git-snapshot failed with message: ${err.message}`)
})

License

MIT

See Also

  • GitHub page : https://github.com/mob-sakai/git-snapshot
  • Changelog : https://github.com/mob-sakai/git-snapshot/blob/master/CHANGELOG.md
  • npm page : https://www.npmjs.com/package/git-snapshot
  • gitgraph.js (a git graph tool) : https://github.com/nicoespeon/gitgraph.js/tree/master/packages/gitgraph-js
  • semantic-release (a npm release tool) : https://github.com/semantic-release/semantic-release

become_a_sponsor_on_github