diff --git a/examples/bitbucket.md b/examples/bitbucket.md index 7a3f041..c61194b 100644 --- a/examples/bitbucket.md +++ b/examples/bitbucket.md @@ -1,4 +1,8 @@ -# Bitbucket Cloud +# Bitbucket Examples + +> Note: all command line arguments can be set in your $HOME/.config/ghorg/conf.yaml + +## Bitbucket Cloud Clone the microsoft workspace using an app-password @@ -12,10 +16,10 @@ Clone the microsoft workspace using oauth token ghorg clone microsoft --scm=bitbucket --token= ``` -# Hosted Bitbucket +## Hosted Bitbucket -Clone the foobar workspace on a hosted bitbucket instance using an app-password +Clone a workspace on a hosted bitbucket instance using an app-password ``` -ghorg clone foobar --scm=bitbucket --bitbucket-username= --token= --base-url=https://api.myhostedbb.com/v2 +ghorg clone --scm=bitbucket --bitbucket-username= --token= --base-url=https:///v2 ``` diff --git a/examples/gitea.md b/examples/gitea.md new file mode 100644 index 0000000..d04766e --- /dev/null +++ b/examples/gitea.md @@ -0,0 +1,21 @@ +# Gitea Examples + +> Note: all command line arguments can be set in your $HOME/.config/ghorg/conf.yaml + +clone an **org** + +``` +ghorg clone --base-url=https://.com --token=XXXXXXX +``` + +clone a **users** repos + +``` +ghorg clone --clone-type=user --base-url=https://.com --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2 +``` + +clone all repos from a **github org** that are **prefixed** with "frontend" **into a folder** called "design_only" + +``` +ghorg clone --match-regex=^frontend --output-dir=design_only --base-url=https://.com --token=XXXXXXX +``` diff --git a/examples/github.md b/examples/github.md index 7524361..9315068 100644 --- a/examples/github.md +++ b/examples/github.md @@ -1,39 +1,43 @@ -# GitHub Cloud +# GitHub Examples -clone a **users** repos, assumes ghorg conf.yaml is setup with a token +> Note: all command line arguments can be set in your $HOME/.config/ghorg/conf.yaml -``` -ghorg clone --clone-type=user -``` +## GitHub Cloud clone an **org**, using a token on the commandline ``` -ghorg clone --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2 +ghorg clone --token=XXXXXX ``` clone all repos from a **github org** that are **prefixed** with "frontend" **into a folder** called "design_only", assumes ghorg conf.yaml is setup with a token ``` -ghorg clone --match-regex=^frontend --output-dir=design_only +ghorg clone --match-regex=^frontend --output-dir=design_only --token=XXXXXX ``` -# GitHub Enterprise - -clone a **users** repos +clone a **users** repos, assumes ghorg conf.yaml is setup with a token ``` -ghorg clone --clone-type=user --base-url=https://internal.github.com --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2 +ghorg clone --clone-type=user --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2 ``` +## GitHub Enterprise + clone an **org** ``` -ghorg clone --base-url=https://your.internal.github.com --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2 +ghorg clone --base-url=https://.com --token=XXXXXX ``` clone all repos from a **github org** that are **prefixed** with "frontend" **into a folder** called "design_only" ``` -ghorg clone --match-regex=^frontend --output-dir=design_only --base-url=https://your.internal.github.com +ghorg clone --match-regex=^frontend --output-dir=design_only --base-url=https://.com --token=XXXXXX +``` + +clone a **users** repos + +``` +ghorg clone --clone-type=user --base-url=https://.com --token=XXXXXX ``` diff --git a/examples/gitlab.md b/examples/gitlab.md index 6634f8b..c181663 100644 --- a/examples/gitlab.md +++ b/examples/gitlab.md @@ -1,18 +1,22 @@ +# GitLab Examples + +> Note: all command line arguments can be set in your $HOME/.config/ghorg/conf.yaml + ## Hosted GitLab Instances -**Note: "all-groups" only works on GitLab instances running 13.0.1 or greater** +**Note: "all-groups" only works on hosted GitLab instances running 13.0.1 or greater** clone all groups on a **hosted gitlab** instance **preserving** the directory structure of subgroups ``` -ghorg clone all-groups --base-url=https:// --scm=gitlab --token=XXXXXXXXXXXXX --preserve-dir +ghorg clone all-groups --base-url=https:// --scm=gitlab --token=XXXXXX --preserve-dir ``` clone a **user** on a **hosted gitlab** instance using a **token** for auth ``` -ghorg clone --clone-type=user --base-url=https:// --scm=gitlab --token=XXXXXXXXXXXXX +ghorg clone --clone-type=user --base-url=https:// --scm=gitlab --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2 ``` clone a **group** on a **hosted gitlab** instance **preserving** the directory structure of subgroups @@ -35,16 +39,16 @@ ghorg clone --base-url=https:// --scm=g ## Cloud GitLab Orgs -eg. https://gitlab.com/fdroid +eg. https://gitlab.com/gitlab-examples clone all groups **preserving** the directory structure of subgroups ``` -ghorg clone fdroid --scm=gitlab --token=XXXXXXXXXXXXX --preserve-dir +ghorg clone gitlab-examples --scm=gitlab --token=XXXXXX --preserve-dir ``` clone only a **subgroup** ``` -ghorg clone fdroid/metrics-data --scm=gitlab --token=XXXXXXXXXXXXX +ghorg clone gitlab-examples/wayne-enterprises --scm=gitlab --token=XXXXXX ``` diff --git a/sample-conf.yaml b/sample-conf.yaml index 7b077b9..769573c 100644 --- a/sample-conf.yaml +++ b/sample-conf.yaml @@ -30,6 +30,12 @@ GHORG_OUTPUT_DIR: # flag (--clone-type, -c) eg: --clone-type=user GHORG_CLONE_TYPE: org +# Change SCM api base url, this is for on self hosted scm instances only +# For http gitlab instances see GHORG_INSECURE_GITLAB_CLIENT +# default: github/gitlab/bitbucket public apis +# flag (--base-url) eg: --base-url=https://my.self.hosted.scm.instance.com +GHORG_SCM_BASE_URL: + # Deletes all files/directories found in your local clone directory that are not found on the remote (e.g., after remote deletion). With GHORG_SKIP_ARCHIVED set, archived repositories will also be pruned from your local clone. # Will prompt before deleting any files unless used in combination with --prune-no-confirm # flag (--prune) @@ -39,12 +45,6 @@ GHORG_PRUNE: false # flag (--prune-no-confirm) GHORG_PRUNE_NO_CONFIRM: false -# Change SCM base url, for on self hosted instances, gitea requires this. -# For http gitlab instances see GHORG_INSECURE_GITLAB_CLIENT -# default: uses github/gitlab public api -# flag (--base-url) eg: --base-url=https://my.self.hosted.scm.instance.com -GHORG_SCM_BASE_URL: - # Color output (enabled, disabled) # flag (--color) eg: --color=disabled GHORG_COLOR: disabled