Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/richardlitt/add-file-to-github-repo
Add a file to a GitHub repository
https://github.com/richardlitt/add-file-to-github-repo
add cli file github
Last synced: 5 days ago
JSON representation
Add a file to a GitHub repository
- Host: GitHub
- URL: https://github.com/richardlitt/add-file-to-github-repo
- Owner: RichardLitt
- License: mit
- Created: 2017-10-14T19:30:05.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2020-05-11T17:15:40.000Z (over 4 years ago)
- Last Synced: 2024-12-22T04:54:33.281Z (12 days ago)
- Topics: add, cli, file, github
- Language: JavaScript
- Homepage:
- Size: 1.52 MB
- Stars: 2
- Watchers: 4
- Forks: 3
- Open Issues: 6
-
Metadata Files:
- Readme: readme.md
- Contributing: CONTRIBUTING.md
- License: license
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# add-file-to-github-repo
[![Greenkeeper badge](https://badges.greenkeeper.io/RichardLitt/add-file-to-github-repo.svg)](https://greenkeeper.io/)
[![Build Status](https://travis-ci.org/RichardLitt/add-file-to-github-repo.svg?branch=master)](https://travis-ci.org/RichardLitt/add-file-to-github-repo) [![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)
> Add a file to a GitHub repository
## Install
```
$ npm install --save add-file-to-github-repo
```## Usage
```js
const addFileToGithubRepo = require('add-file-to-github-repo');addFileToGithubRepo('unicorns', 'RichardLitt/here', {
path: '.github/unicorns'
})
//=> 'Done'
```## API
### addFileToGithubRepo(file, repository, [options])
##### file
Type: `string`
The file.
#### repo
Type: `string`
In the format 'user/repo'
#### options
#### branch
Type: `string`
Default: `master`The branch to commit to.
#### message
Type: `string`
The commit message. Default: `chore(filename): init file.`
#### path
Type: `string`
Where to save the file.
## CLI
```
$ npm install --global add-file-to-github-repo
``````
$ add-file-to-github-repo --helpUsage
$ add-file-to-github-repo [file] [repo]Options
-b, --branch GitHub branch [Default: default_branch of repo]
-i, --input Input file path
-r, --repo Repository. Format: 'user/repo'
-m, --message Commit message [Default: chore(filename): init file]
-p, --path Where to put the fileExamples
$ GITHUB_TOKEN=abc... add-file-to-github-repo 'file' 'RichardLitt/add-file-to-github-repo'
```## Contribute
PRs accepted. Check out the [issues](https://github.com/RichardLitt/add-file-to-github-repo/issues)!
## License
[MIT](LICENSE) © [Richard Littauer](https://burntfen.com)