gitemplate

Git cloning with template variables

gitemplate

Git cloning with template variables.

  • Replace variables in file names and content.
  • Optional GitHub repo init and remote origin setup.
  • Custom post-processing scripts.

gitemplate --name my-new-project \
           --src git@github.com:me/my-old-template.git \
           --dst ~/dev/my-new-project \
           --desc 'gets it done' \
gitemplate --name my-new-project \
           --src git@github.com:me/my-old-template.git \
           --dst ~/dev/my-new-project \
           --desc 'gets it done' \
           --repo me/my-new-project

More

Case-insensitive.

Same as --name.

Same as --desc.

Same as --repo.

Will also trigger init and remote add origin.

Full year in local time. (Only replaced in file content.)

Cloned origin's commit SHA-1 (first 10 chars). (Only replaced in file content.)

Cloned origin's URL. (Only replaced in file content.)

Will also replace in file names and content. Case insensitive.

gitemplate_engineVer
/path/to/gitemplate_engineVer.js
--json '{"engineVer":"0.10.1"}'

Post-processing scripts

Will be auto-deleted after successful execution.

Add an executable .gitemplate.postreplace file to the root.

node.js example that installs all dependencies and runs the unit tests:

#!/bin/sh

npm install
npm test

NPM

npm install gitemplate

MIT

npm test