repo_publish_to_gh

This function will publish the existing local Git repository in the given directory ($PWD if not given) to GitHub as a private repository.

The optional second parameter is the remote name for the repository (defaults to the directory name if not given).

Only the default branch (default: main) will be published.

Sometimes GitHub is slow or you have bad latency. In that case you need to increase the time used to wait between GitHub interactions:

zfunc/repo_publish_to_gh
wait_for_github=10

Usage

$ pwd
/tmp/first
$ repo_publish_to_gh
✓ Created repository sdavids/first on GitHub
  https://github.com/sdavids/first
...

$ repo_publish_to_gh /tmp/second
✓ Created repository sdavids/second on GitHub
  https://github.com/sdavids/second
...

$ repo_publish_to_gh /tmp/third different
✓ Created repository sdavids/different on GitHub
  https://github.com/sdavids/different
...

Prerequisites

More Information