Take a snapshot of the directory - like 'git subtree split --squash'
npm install git-snapshotgit-snapshot is a tool to _take a snapshot of the directory and creates/updates another branch_, like git subtree split --squash.


!license
!downloads
!release

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
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|
|
|
|
Install globally (add to your PATH) and you can use git-snapshot as a git sub-command.
``bash`
$ npm install -g git-snapshot
For Node modules projects we recommend installing git-snapshot locally.
`bash`
$ npm install --save git-snapshot
`
usage: git snapshot --prefix=
[--tag=
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]
`
`js
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})``
})
MIT
- 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
