gitlab-force-upload
A Golang script to force upload a folder into a GitLab repository.
Currently used to update the Coq XML Uploads on MathHub.
Usage
Usage of gitlab-force-upload:
-dest string
Destination repository (required)
-folder string
Folder to upload to GitLab (required)
-legal
Show legal information and exit
-token string
Token for GitLab (required)
-url string
GitLab URL to connect to (default "https://gitlab.com")
-pro
Assume that a non-community edition of GitLab is used
-v Log more verbose
Concretly, it performs the following actions:
- Create a remote gitlab repository, if it does not yet exist
- Unprotect the main branch
- Create a new local repository, deleting any older one if it exists
- Create a single new commit in the repository
- Force-push this commit to the remote.
getting gitlab-force-upload
To get gitlab-force-upload
you have two options:
-
Build it yourself. To build gitlab-force-upload
yourself, you need go 1.9 or newer along with make installed on your machine. After cloning this repository, you can then simply type make and executables will be generated inside the out/ directory.
-
Download a pre-built binary. You can download a pre-built binary from the releases page on GitHub. This page includes releases for Linux, Mac OS X and Windows. Note that these binaries are compressed with upx
in order to decrease executable size.
After obtaining the binary (through either of the two means), simply place it in your $PATH.
It does not depend on any external software (no need for git even, although having it may dramatically increase performance on big repositories).
License
Released into the public domain, concretely licensed under the terms of the Unlicense.