Download any repository or subdirectory on GitHub with support for Node.js and the CLI
npx go-git-it <url> [outputDir]
Use cases
# cwd is ~/mydevspace/
npx go-git-it https://github.com/username/repository
# copied remote content to ~/mydevspace/repository
npx go-git-it https://github.com/username/repository/tree/main/folder
# copied remote content to ~/mydevspace/folder
npx go-git-it https://github.com/username/repository/blob/main/folder/file.js
# copied remote content to ~/mydevspace/file.js
The second command argument is the output directory:
npx go-git-it https://github.com/username/repository path/to/outputDir
# copied remote content to path/to/outputDir/repository
go-git-it
can also run on a Node.js program.
npm install go-git-it
import goGitIt from "go-git-it";
// Assume cwd is ~/mydevspace/
await goGitIt("https://github.com/username/repository");
// copied remote content to ~/mydevspace/repository
await goGitIt("https://github.com/username/repository/tree/main/folder");
// copied remote content to ~/mydevspace/folder
await goGitIt(
"https://github.com/username/repository/blob/main/folder/file.js",
);
// copied remote content to ~/mydevspace/file.js
The second parameter is the output path:
import goGitIt from "go-git-it";
// Assume cwd is ~/mydevspace/
await goGitIt("https://github.com/username/repository", "path/to/outputDir");
// copied remote content to path/to/outputDir/repository
Type: string
The URL to the path you want to download. If a folder, will download its content as well.
Type: string
Custom path to the outputDir (defaults to the working directory)
Type: string
Adds a custom text message instead of default config. This option overrides the success message as well.
- Progress bar showing download status
- Support for downloading entire repositories
- Support for downloading specific folders
- Support for downloading individual files
- Custom output directory support
- Custom progress messages
MIT (c) Cezar Augusto.