https://github.com/marcbachmann/github-remote-commit
:octocat: Github commit & pull request cli
https://github.com/marcbachmann/github-remote-commit
Last synced: about 2 months ago
JSON representation
:octocat: Github commit & pull request cli
- Host: GitHub
- URL: https://github.com/marcbachmann/github-remote-commit
- Owner: marcbachmann
- Created: 2016-03-18T00:50:21.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2023-12-15T08:16:31.000Z (over 2 years ago)
- Last Synced: 2024-04-14T14:40:22.295Z (about 2 years ago)
- Language: JavaScript
- Homepage:
- Size: 4.88 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# github-remote-commit
## cli
### Commit a file
```bash
commit package.json \
-m 'Foo bar' \
-b user/repo:master \
-h fix-foo \
-t [github-token]
```
### Create a pull request
```bash
pull-request \
-b user/repo:master \
-h user/repo:fix-foo \
--title 'Title of pull request' \
--body 'Optional body of pull request' \
-t [github-token]
```
### Commit and create a pull request at once
```bash
pull-request package.json
-t [github-token]
-m 'Upgrade Version'
-h user/repo:fix-foo \
-b user/repo:master \
--title 'Title of pull request'
```
The module **will** support std-input for the file content
```bash
commit package.json -b user/repo:master -h foobar -m 'Foo bar' -
```
## api
```javascript
var github = require('github-remote-commit')
github.commit(config, callback)
github.pullRequest(config, callback)
```
### github.commit config
```javascript
{
token: 'github token'
message: 'commit message',
// one file
file: {path: 'path/to/file.js', content: 'content as string'},
// or many
files: [{path: 'path/to/file.js', content: 'content as string'}],
base: 'user/repo:branch', # use user/repo:master
head: 'branch-to-create' # just use 'master' if
# you want to commit to that branch
```
### github.pullRequest config
```javascript
{
token: 'github token',
message: 'commit message',
// one file
file: {path: 'path/to/file.js', content: 'content as string'},
// or many
files: [{path: 'path/to/file.js', content: 'content as string'}],
base: 'user/repo:branch', # use user/repo:master
head: 'branch-to-create', # just use 'master' if
# you want to commit to that branch
pr: {
title: 'Pull request title',
body: 'Pull request body',
// or
issue: 1 // issue to convert
}
```