A generator to initialize a project with git.
Features
- Initalize git repo
- Create .gitignore from templates
- Setup a remote origin
- Create first commit
$ npm init git
# or
$ npx create-git
# or
$ npm install -g create-git
$ create-git
$ create-git --help
Usage: create-git [options] <directory>
Options:
-V, --version output the version number
--silent Surpress output
--no-prompt Skip prompts and just use input options
--ignore-existing Ignore existing package.json
-m --initial-commit-message The initial commit message
-o --origin Set the remote origin
-t --templates Ignor templates to load
-h, --help output usage information
const createGit = require('create-git')
;(async () => {
await createGit({
ignoreExisting: false,
initialCommitMessage: '',
remoteOrigin: '',
ignoreTemplates: ['Node.gitignore']
})
})()