package
Initalize a git repository with some helpful extras
npm install create-gitGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
A generator to initialize a project with git.
Features
$ npm init git
# or
$ npx create-git
# or
$ npm install -g create-git
$ create-git$ create-git --help
create-git
initalize a git repo
Options:
--help Show help [boolean]
--version Show version number [boolean]
--cwd, -d Directory to run in [default: process.cwd()]
--primary-branch, -b Primary branch for repo [string] [default: main]
--initial-commit-message, -m Message for initial commit [string]
--remote-origin, -o Git remote origin [string]
--ignore-templates, -t Ignore templates from
github.com/github/gitignore
[default: Node.gitignore]
--additional-rules comma separated list of ignore lines [string]
--ignore-existing Ignore existing .gitignore and package.json
files [default: false]
--commit-all Commit all files (not just the new .gitignore
[boolean] [default: true]
--push Push to remote origin when complete
[boolean] [default: true]const createGit = require('create-git')
await createGit({
primartBranch: 'main',
ignoreExisting: false,
initialCommitMessage: '',
remoteOrigin: '', // Will also load from the package.json repository field
ignoreTemplates: ['Node.gitignore'],
additionalRules: [],
push: true,
commitAll: true
})create-* packagesThis generator is built on top of opta, a helper library for collecting
user input from multiple interfaces: CLI via yargs, interactive prompts via inquirer
and via a JS interface. To compose with other opta based input collection,
you can use .options to access the cli/prompt/js configurations.
const createGit = require('create-git')
const opta = require('opta')
// My wrapper which asks github username and repo to
// generate the `remoteOrigin`
const opts = opta({
commandDescription: 'Create github repo',
options: {
// Spread the options from createGit
...createGit.options,
// Add our additional prompts
githubOrg: {
prompt: {
message: 'GitHub User/Org:'
}
},
githubRepo: {
prompt: {
message: 'GitHub repo:'
}
},
// Override createGit.options.remoteOrigin
For more information check out the docs for opta.
Estimated unpacked size across 43 packages.
3.0 MB
Includes dependencies.
6 direct · 3 outdated
^11.8.6
16.2.0
^1.0.2
1.1.6
^3.3.0
4.6.0
^11.1.1
11.4.1
^1.0.1
2.0.0
^0.1.1
0.1.1