Skip to content

Commit

Permalink
Format docs
Browse files Browse the repository at this point in the history
  • Loading branch information
maetthu committed Feb 21, 2021
1 parent d54c2d9 commit a625fae
Showing 1 changed file with 25 additions and 19 deletions.
44 changes: 25 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,41 @@ $ export GITHUB_TOKEN="your-personal-access-token"
## Usage

```
Uploads (commits) a local file to a github repository
Usage:
ghupload upload -m <commit-msg> [-b <branch>] <local-path> <remote-url>
<local-path> is either a path to a local file or - for STDIN.
<remote-url> can be one of the following formats and has to include the repository owner, the repository and the path to the file inside the repository:
Flags:
-b, --branch string Commit to branch (default branch if empty)
-m, --message string Commit message (required)
```

_local-path_ is either a path to a local file or "-" for STDIN.

_remote-url_ can be one of the following formats and has to include the repository owner, the repository and the path to the file inside the repository:
* https://github.com/owner/repository/path/in/repo
* git@github.com:owner/repository.git/path/in/repo
* owner/repository/path/in/repo

Command prints the commit SHA on success.

Usage:
ghupload upload -m <commit-msg> [-b <branch>] <local-path> <remote-url>
### Examples

* Upload file

```shell
$ ghupload upload -m "commit msg" README.md invit/ghupload/README.md
b6cbb5b2ea041956c4ac8da17007f95d2312a461
```

Examples:
* Upload local file
$ ghupload upload -m "commit msg" README.md owner/repository/README.md
b6cbb5b2ea041956c4ac8da17007f95d2312a461
* Upload data from STDIN
$ ghupload upload -m "commit msg" - owner/repository/README.md
this is the new
content
of the file
^D
3be39e60c3ae44faa40f4efc31241f3564c396f1

Flags:
-b, --branch string Commit to branch (default branch if empty)
-h, --help help for upload
-m, --message string Commit message (required)
```shell
$ ghupload upload -m "commit msg" - invit/ghupload/README.md
this is the new
content
of the file
^D
3be39e60c3ae44faa40f4efc31241f3564c396f1
```

## Build
Expand Down

0 comments on commit a625fae

Please sign in to comment.