Skip to content

Commit

Permalink
help
Browse files Browse the repository at this point in the history
  • Loading branch information
xiangnanscu committed Feb 15, 2024
1 parent f1fc890 commit 791c317
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 12 deletions.
32 changes: 30 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# degit — straightforward project scaffolding
# @xiangnanscu/degit — straightforward project scaffolding

[![Travis CI build status](https://badgen.net/travis/Rich-Harris/degit/master)](https://travis-ci.org/Rich-Harris/degit)
[![AppVeyor build status](https://badgen.net/appveyor/ci/Rich-Harris/degit/master)](https://ci.appveyor.com/project/Rich-Harris/degit/branch/master)
Expand All @@ -12,14 +12,42 @@

_Requires Node 8 or above, because `async` and `await` are the cat's pyjamas_

# Enhance from origin degit

- `degit some-repo` intead of `degit some-user/some-repo`

When you've already login [gh](https://cli.github.com/) (say, login as `some-user`), you run `degit some-repo` and , it will be the same as `degit some-user/some-repo`

- `--github` flag to create github remote repo from working folder

- `--git` flag to run `git init` in working folder

- `--subdir` flag to fetch sub directory when in gh mode

## Installation

```bash
npm install -g degit
npm install -g @xiangnanscu/degit
```

## Usage

### gh mode
assuming you login [gh](https://cli.github.com/) as `user`
```bash
# same as degit user/repo
degit repo

# initialize a github repo `user/somedir` from `user/repo` (commit and push immediately)
cd somedir && degit repo --github

# or like this
degit repo somedir --github

# or initialize `user/somedir` from `user/templates-repo/templateA`
degit templates-repo somedir --github --subdir=templateA
```

### Basics

The simplest use of degit is to download the master branch of a repo from GitHub to the current working directory:
Expand Down
5 changes: 4 additions & 1 deletion help.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,8 @@ Options:
`--verbose`, `-v` Extra logging
`--mode=`, `-m=` Force the mode by which degit clones the repo
Valid options are `tar` or `git` (uses SSH)
`--github`, `-g` Create github remote repo from working folder
`--git`, flag to run `git init` in working folder
`--subdir=`, `-s`, Fetch sub directory when in gh mode

See https://github.com/Rich-Harris/degit for more information
See https://github.com/xiangnanscu/degit for more information
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
{
"name": "@xiangnanscu/degit",
"version": "2.21.0",
"version": "2.22.0",
"engines": {
"node": ">=8.0.0"
},
"description": "Straightforward project scaffolding",
"main": "dist/index.js",
"bin": {
"degit": "degit",
"gitt": "degit"
"degit": "degit"
},
"scripts": {
"lint": "eslint --color --ignore-path .gitignore .",
"dev": "npm run build -- --watch",
"build": "rollup -c",
"build": "rollup -c;cp help.md dist",
"prerc": "npm --no-git-tag-version version minor",
"rc": "npm run push",
"commit": "git add . && git commit -am ",
Expand All @@ -23,7 +22,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/Rich-Harris/degit.git"
"url": "git+https://github.com/xiagnnanscu/degit.git"
},
"keywords": [
"scaffolding",
Expand All @@ -33,9 +32,9 @@
"author": "Rich Harris",
"license": "MIT",
"bugs": {
"url": "https://github.com/Rich-Harris/degit/issues"
"url": "https://github.com/xiagnnanscu/degit/issues"
},
"homepage": "https://github.com/Rich-Harris/degit#readme",
"homepage": "https://github.com/xiagnnanscu/degit#readme",
"devDependencies": {
"@rollup/plugin-commonjs": "18.0.0",
"@rollup/plugin-node-resolve": "11.2.1",
Expand Down

0 comments on commit 791c317

Please sign in to comment.