gbulk
is a CLI built to work with Github repositories in bulk.
- Authentication through Github OAuth personal access token
- Backup of authenticated user’s repositories, with support of filters on repository privacy (public and/or private) and affiliation (owner and/or collaborator and/or member)
- Interactive mode for the lazy
Coming soon:
- Backup of any user/organization repositories user has access to
- Transfering
- Archiving
$ npm install -g @g-script/gbulk
$ gbulk COMMAND
running command...
$ gbulk (-v|--version|version)
@g-script/gbulk/1.1.0 linux-x64 node-v12.14.1
$ gbulk --help [COMMAND]
USAGE
$ gbulk COMMAND
...
After installation, the only thing you need to do is generate a new personal access token with following permissions :
- repo / public_repo - minimum requirement to backup a user/organization public repositories
- repo - required to backup private repositories
Then run gbulk login
backup repositories
USAGE
$ gbulk backup [FROM] [DESTINATION]
ARGUMENTS
FROM user name or organization name to backup from
DESTINATION backup destination path
OPTIONS
-c, --clean-refs clean GitHub specific pull refs (refs/pull) from backup repositories
-h, --help show CLI help
-i, --interactive interactive mode
-m, --match=match include only repositories whose name is matching specified string or regex pattern (omitting
start and end delimiters)
-p, --parallel=parallel [default: 8] backup multiple repositories in parallel
-q, --quiet disable logging
-x, --exclude=exclude exclude repositories whose name is matching specified string or regex pattern (omitting start
and end delimiters)
--[no-]collaborator include/exclude repositories where user is collaborator
--[no-]lfs include LFS objects in backup
--[no-]member include/exclude repositories where user is member
--[no-]owner include/exclude owned repositories
--private include/exclude private repositories
--public include/exclude public repositories
DESCRIPTION
With gbulk, you can backup from different sources:
- to backup repositories you own, run gbulk backup without arguments (if you want to specify a backup path, use gbulk
backup $YOUR_USERNAME $BACKUP_PATH)
- to backup repositories of another user, run gbulk backup $USERNAME
- to backup repositories of an organization, run gbulk backup $ORGNAME
Git LFS objects will be backup if git-lfs is available in path.
See code: src/commands/backup.js
display help for gbulk
USAGE
$ gbulk help [COMMAND]
ARGUMENTS
COMMAND command to show help for
OPTIONS
--all see all commands in CLI
See code: @oclif/plugin-help
login to Github
USAGE
$ gbulk login
OPTIONS
-h, --help show CLI help
-v, --verbose verbose mode
DESCRIPTION
To authenticate to Github with gbulk, go grab a personal access token at https://github.com/settings/tokens
Each command needs access to different scopes, see individual command help section to know which scopes are needed.
See code: src/commands/login.js
logout from Github
USAGE
$ gbulk logout
OPTIONS
-h, --help show CLI help
DESCRIPTION
Erase authentication details from configuration file
See code: src/commands/logout.js