mirror of
https://github.com/outbackdingo/ghorg.git
synced 2026-01-27 10:19:03 +00:00
update examples
This commit is contained in:
@@ -104,6 +104,7 @@ go get github.com/gabrie30/ghorg
|
||||
### github setup
|
||||
1. Create [Personal Access Token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) with all `repo` scopes. Update `GHORG_GITHUB_TOKEN` in your `ghorg/conf.yaml` or as a cli flag. If your org has Saml SSO in front you will need to give your token those permissions as well, see [this doc](https://docs.github.com/en/github/authenticating-to-github/authenticating-with-saml-single-sign-on/authorizing-a-personal-access-token-for-use-with-saml-single-sign-on).
|
||||
1. For cloning GitHub Enterprise repos you must set `--base-url` e.g. `ghorg clone <github_org> --base-url=https://internal.github.com`
|
||||
1. See [examples/github.md](https://github.com/gabrie30/ghorg/blob/master/examples/github.md) on how to run
|
||||
|
||||
### gitlab setup
|
||||
|
||||
@@ -149,6 +150,7 @@ $ ghorg clone fdroid --scm=gitlab --token=XXXX --preserve-dir
|
||||
1. Create [Access Token](https://docs.gitea.io/en-us/api-usage/) (Settings -> Applications -> Generate Token)
|
||||
1. Update `GHORG_GITEA_TOKEN` in your `ghorg/conf.yaml` or use the (--token, -t) flag.
|
||||
1. Update `GHORG_SCM_TYPE` to `gitea` in your `ghorg/conf.yaml` or via cli flags
|
||||
1. See [examples/gitea.md](https://github.com/gabrie30/ghorg/blob/master/examples/gitea.md) on how to run
|
||||
|
||||
### bitbucket setup
|
||||
|
||||
@@ -156,12 +158,15 @@ $ ghorg clone fdroid --scm=gitlab --token=XXXX --preserve-dir
|
||||
|
||||
1. To configure with bitbucket you will need to create a new [app password](https://confluence.atlassian.com/bitbucket/app-passwords-828781300.html) and update your `$HOME/.config/ghorg/conf.yaml` or use the (--token, -t) and (--bitbucket-username) flags.
|
||||
1. Update [SCM type](https://github.com/gabrie30/ghorg/blob/master/sample-conf.yaml#L54-L57) to `bitbucket` in your `ghorg/conf.yaml` or via cli flags
|
||||
1. See [examples/bitbucket.md](https://github.com/gabrie30/ghorg/blob/master/examples/bitbucket.md) on how to run
|
||||
|
||||
#### PAT/OAuth token
|
||||
|
||||
1. Create a [PAT](https://confluence.atlassian.com/bitbucketserver/personal-access-tokens-939515499.html)
|
||||
1. Set the token with `GHORG_BITBUCKET_OAUTH_TOKEN` in your `$HOME/.config/ghorg/conf.yaml` or using the `--token` flag. Make sure you do not have `--bitbucket-username` set.
|
||||
1. Update SCM TYPE to `bitbucket` in your `ghorg/conf.yaml` or via cli flags
|
||||
1. See [examples/bitbucket.md](https://github.com/gabrie30/ghorg/blob/master/examples/bitbucket.md) on how to run
|
||||
|
||||
|
||||
## How to Use
|
||||
|
||||
|
||||
@@ -1,25 +1,25 @@
|
||||
# Bitbucket Examples
|
||||
|
||||
> Note: all command line arguments can be set in your $HOME/.config/ghorg/conf.yaml
|
||||
> Note: all command line arguments can be set in your $HOME/.config/ghorg/conf.yaml for more information see the [configuration](https://github.com/gabrie30/ghorg#configuration) section of the readme
|
||||
|
||||
## Bitbucket Cloud
|
||||
|
||||
Clone the microsoft workspace using an app-password
|
||||
1. Clone the microsoft workspace using an app-password
|
||||
|
||||
```
|
||||
ghorg clone microsoft --scm=bitbucket --bitbucket-username=<your-username> --token=<app-password>
|
||||
```
|
||||
```
|
||||
ghorg clone microsoft --scm=bitbucket --bitbucket-username=<your-username> --token=<app-password>
|
||||
```
|
||||
|
||||
Clone the microsoft workspace using oauth token
|
||||
1. Clone the microsoft workspace using oauth token
|
||||
|
||||
```
|
||||
ghorg clone microsoft --scm=bitbucket --token=<oauth-token>
|
||||
```
|
||||
```
|
||||
ghorg clone microsoft --scm=bitbucket --token=<oauth-token>
|
||||
```
|
||||
|
||||
## Hosted Bitbucket
|
||||
|
||||
Clone a workspace on a hosted bitbucket instance using an app-password
|
||||
1. Clone a workspace on a hosted bitbucket instance using an app-password
|
||||
|
||||
```
|
||||
ghorg clone <workspace> --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
|
||||
```
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
# Gitea Examples
|
||||
|
||||
> Note: all command line arguments can be set in your $HOME/.config/ghorg/conf.yaml
|
||||
> Note: all command line arguments can be set in your $HOME/.config/ghorg/conf.yaml for more information see the [configuration](https://github.com/gabrie30/ghorg#configuration) section of the readme
|
||||
|
||||
clone an **org**
|
||||
1. Clone an **org**
|
||||
|
||||
```
|
||||
ghorg clone <gitea_org> --base-url=https://<your-internal-gitea>.com --token=XXXXXXX
|
||||
```
|
||||
```
|
||||
ghorg clone <gitea_org> --base-url=https://<your-internal-gitea>.com --token=XXXXXXX
|
||||
```
|
||||
|
||||
clone a **users** repos
|
||||
1. Clone a **users** repos
|
||||
|
||||
```
|
||||
ghorg clone <gitea_username> --clone-type=user --base-url=https://<your-internal-gitea>.com --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2
|
||||
```
|
||||
```
|
||||
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"
|
||||
1. 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
|
||||
```
|
||||
```
|
||||
ghorg clone <gitea_org> --match-regex=^frontend --output-dir=design_only --base-url=https://<your-internal-gitea>.com --token=XXXXXXX
|
||||
```
|
||||
|
||||
@@ -1,43 +1,43 @@
|
||||
# GitHub Examples
|
||||
|
||||
> Note: all command line arguments can be set in your $HOME/.config/ghorg/conf.yaml
|
||||
> Note: all command line arguments can be set in your $HOME/.config/ghorg/conf.yaml for more information see the [configuration](https://github.com/gabrie30/ghorg#configuration) section of the readme
|
||||
|
||||
## GitHub Cloud
|
||||
|
||||
clone an **org**, using a token on the commandline
|
||||
1. Clone an **org**, using a token on the commandline
|
||||
|
||||
```
|
||||
ghorg clone <github_org> --token=XXXXXX
|
||||
```
|
||||
```
|
||||
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
|
||||
1. 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 --token=XXXXXX
|
||||
```
|
||||
```
|
||||
ghorg clone <github_org> --match-regex=^frontend --output-dir=design_only --token=XXXXXX
|
||||
```
|
||||
|
||||
clone a **users** repos, assumes ghorg conf.yaml is setup with a token
|
||||
1. Clone a **users** repos, assumes ghorg conf.yaml is setup with a token
|
||||
|
||||
```
|
||||
ghorg clone <github_username> --clone-type=user --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2
|
||||
```
|
||||
```
|
||||
ghorg clone <github_username> --clone-type=user --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2
|
||||
```
|
||||
|
||||
## GitHub Enterprise
|
||||
|
||||
clone an **org**
|
||||
1. Clone an **org**
|
||||
|
||||
```
|
||||
ghorg clone <github_org> --base-url=https://<your-hosted-github>.com --token=XXXXXX
|
||||
```
|
||||
```
|
||||
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"
|
||||
1. 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-hosted-github>.com --token=XXXXXX
|
||||
```
|
||||
```
|
||||
ghorg clone <github_org> --match-regex=^frontend --output-dir=design_only --base-url=https://<your-hosted-github>.com --token=XXXXXX
|
||||
```
|
||||
|
||||
clone a **users** repos
|
||||
1. Clone a **users** repos
|
||||
|
||||
```
|
||||
ghorg clone <github_username> --clone-type=user --base-url=https://<your-hosted-github>.com --token=XXXXXX
|
||||
```
|
||||
```
|
||||
ghorg clone <github_username> --clone-type=user --base-url=https://<your-hosted-github>.com --token=XXXXXX
|
||||
```
|
||||
|
||||
@@ -1,54 +1,54 @@
|
||||
# GitLab Examples
|
||||
|
||||
> Note: all command line arguments can be set in your $HOME/.config/ghorg/conf.yaml
|
||||
> Note: all command line arguments can be set in your $HOME/.config/ghorg/conf.yaml for more information see the [configuration](https://github.com/gabrie30/ghorg#configuration) section of the readme
|
||||
|
||||
## Hosted GitLab Instances
|
||||
|
||||
|
||||
**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
|
||||
1. 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=XXXXXX --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
|
||||
1. 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=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2
|
||||
```
|
||||
```
|
||||
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
|
||||
1. Clone a **group** on a **hosted gitlab** instance **preserving** the directory structure of subgroups
|
||||
|
||||
```
|
||||
ghorg clone <gitlab_group> --base-url=https://<your.instance.gitlab.com> --scm=gitlab --preserve-dir
|
||||
```
|
||||
```
|
||||
ghorg clone <gitlab_group> --base-url=https://<your.instance.gitlab.com> --scm=gitlab --preserve-dir
|
||||
```
|
||||
|
||||
clone only a **subgroup** on a **hosted gitlab**
|
||||
1. Clone only a **subgroup** on a **hosted gitlab**
|
||||
|
||||
```
|
||||
ghorg clone <gitlab_group>/<gitlab_sub_group> --base-url=https://<your.instance.gitlab.com> --scm=gitlab
|
||||
```
|
||||
```
|
||||
ghorg clone <gitlab_group>/<gitlab_sub_group> --base-url=https://<your.instance.gitlab.com> --scm=gitlab
|
||||
```
|
||||
|
||||
clone all repos that are **prefixed** with "frontend" **into a folder** called "design_only" from a **group** on a **hosted gitlab** instance
|
||||
1. clone all repos that are **prefixed** with "frontend" **into a folder** called "design_only" from a **group** on a **hosted gitlab** instance
|
||||
|
||||
```
|
||||
ghorg clone <gitlab_group> --base-url=https://<your.instance.gitlab.com> --scm=gitlab --match-regex=^frontend --output-dir=design_only
|
||||
```
|
||||
```
|
||||
ghorg clone <gitlab_group> --base-url=https://<your.instance.gitlab.com> --scm=gitlab --match-regex=^frontend --output-dir=design_only
|
||||
```
|
||||
|
||||
## Cloud GitLab Orgs
|
||||
|
||||
eg. https://gitlab.com/gitlab-examples
|
||||
|
||||
clone all groups **preserving** the directory structure of subgroups
|
||||
1. clone all groups **preserving** the directory structure of subgroups
|
||||
|
||||
```
|
||||
ghorg clone gitlab-examples --scm=gitlab --token=XXXXXX --preserve-dir
|
||||
```
|
||||
```
|
||||
ghorg clone gitlab-examples --scm=gitlab --token=XXXXXX --preserve-dir
|
||||
```
|
||||
|
||||
clone only a **subgroup**
|
||||
1. clone only a **subgroup**
|
||||
|
||||
```
|
||||
ghorg clone gitlab-examples/wayne-enterprises --scm=gitlab --token=XXXXXX
|
||||
```
|
||||
```
|
||||
ghorg clone gitlab-examples/wayne-enterprises --scm=gitlab --token=XXXXXX
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user