CLI to upload a file to a github repository through github's REST API. The file will be either created or overwritten.
Downloadable binaries are available from the releases page.
- Create a Github personal access token
- Set GITHUB_TOKEN environment variable
$ export GITHUB_TOKEN="your-personal-access-token"
Usage:
ghupload upload <local-path> <remote-url> [flags]
Flags:
-b, --branch string Commit to branch (default branch if empty)
-h, --help help for upload
-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
- [email protected]:owner/repository.git/path/in/repo
- owner/repository/path/in/repo
- Upload file
$ upload -m "commit msg" README.md invit/ghupload/README.md
- Upload data from STDIN
$ upload -m "commit msg" - invit/ghupload/README.md
this is the new
content
of the file
^D
On Linux:
$ git clone github.com/invit/ghupload
$ cd ghupload
$ make
ghupload is licensed under the MIT License.