Update clone examples (#220)

This commit is contained in:
Jay Gabriels
2022-07-24 09:34:57 -07:00
committed by GitHub
parent 3d1785b927
commit 238beb07bd
5 changed files with 62 additions and 29 deletions

View File

@@ -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=<oauth-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=<your-username> --token=<app-password> --base-url=https://api.myhostedbb.com/v2
ghorg clone <workspace> --scm=bitbucket --bitbucket-username=<your-username> --token=<app-password> --base-url=https://<api.myhostedbb.com>/v2
```

21
examples/gitea.md Normal file
View File

@@ -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 <gitea_org> --base-url=https://<your-internal-gitea>.com --token=XXXXXXX
```
clone a **users** repos
```
ghorg clone <gitea_username> --clone-type=user --base-url=https://<your-internal-gitea>.com --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2
```
clone all repos from a **github org** that are **prefixed** with "frontend" **into a folder** called "design_only"
```
ghorg clone <gitea_org> --match-regex=^frontend --output-dir=design_only --base-url=https://<your-internal-gitea>.com --token=XXXXXXX
```

View File

@@ -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 <github_username> --clone-type=user
```
## GitHub Cloud
clone an **org**, using a token on the commandline
```
ghorg clone <github_org> --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2
ghorg clone <github_org> --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 <github_org> --match-regex=^frontend --output-dir=design_only
ghorg clone <github_org> --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 <github_username> --clone-type=user --base-url=https://internal.github.com --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2
ghorg clone <github_username> --clone-type=user --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2
```
## GitHub Enterprise
clone an **org**
```
ghorg clone <github_org> --base-url=https://your.internal.github.com --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2
ghorg clone <github_org> --base-url=https://<your-hosted-github>.com --token=XXXXXX
```
clone all repos from a **github org** that are **prefixed** with "frontend" **into a folder** called "design_only"
```
ghorg clone <github_org> --match-regex=^frontend --output-dir=design_only --base-url=https://your.internal.github.com
ghorg clone <github_org> --match-regex=^frontend --output-dir=design_only --base-url=https://<your-hosted-github>.com --token=XXXXXX
```
clone a **users** repos
```
ghorg clone <github_username> --clone-type=user --base-url=https://<your-hosted-github>.com --token=XXXXXX
```

View File

@@ -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://<your.instance.gitlab.com> --scm=gitlab --token=XXXXXXXXXXXXX --preserve-dir
ghorg clone all-groups --base-url=https://<your.instance.gitlab.com> --scm=gitlab --token=XXXXXX --preserve-dir
```
clone a **user** on a **hosted gitlab** instance using a **token** for auth
```
ghorg clone <gitlab_username> --clone-type=user --base-url=https://<your.instance.gitlab.com> --scm=gitlab --token=XXXXXXXXXXXXX
ghorg clone <gitlab_username> --clone-type=user --base-url=https://<your.instance.gitlab.com> --scm=gitlab --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2
```
clone a **group** on a **hosted gitlab** instance **preserving** the directory structure of subgroups
@@ -35,16 +39,16 @@ ghorg clone <gitlab_group> --base-url=https://<your.instance.gitlab.com> --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
```

View File

@@ -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