Git Product home page Git Product logo

ghrepo's Introduction

ghrepo

stable

Creates a new GitHub repository from your current folder, and then runs the initial git commands to commit and push the contents. If the folder has a package.json it will pull the repo's description, name and homepage from that.

Install:

npm install ghrepo -g

The example below pushes the contents of my-module to a new GitHub repository with the specified commit message. On first run, it will prompt for authentication.

#make a new module
mkdir my-module
cd my-module
npm init

#create a new GitHub repository
ghrepo -m 'first commit yolo'

This should open the browser to the newly created GitHub repository on your account, and push the current contents of the folder.

result

Usage

NPM

Usage:
  ghrepo [opts]

Options:
  --help              show help
  --version, -v       prints version number
  --name, -n          the name of the repository
  --description, -d   the description
  --homepage, -h      the homepage URL
  --private, -p       mark the repository as private (default false)
  --message, -m       the commit message (default "first commit")
  --bare, -b          do not run any git commands after creating the repo
  --no-open           do not open the GitHub repo in the browser after creation
  --org, -o           the organization to create the repo in (optional)

The --name, --description, and --homepage will default to package.json. If no package.json is found, --name defaults to the current folder's name.

The --org will default to the same user as specified in the repository URL in package.json. Otherwise, it will default to the username specified from the initial authentication.

Default Commit Message

You can personalize the default commit message with npm config:

npm config set init.ghrepo.message 'YOLO!'

Now --message will default to 'YOLO!'.

License

MIT, see LICENSE.md for details.

ghrepo's People

Contributors

mattdesl avatar brendanneufeld avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.