diff --git a/README.md b/README.md index e35a466..9a2f9da 100644 --- a/README.md +++ b/README.md @@ -114,22 +114,6 @@ docker run ghorg-docker ./ghorg clone kubernetes --token=bGVhdmUgYSBjb21tZW50IG9 docker run -v $HOME/ghorg/:/root/ghorg/ ghorg-docker ./ghorg clone kubernetes --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2 --output-dir=cloned-from-docker ``` -## Use - -```bash -# note: to view/set all available flags/features see sample-conf.yaml -# note: for examples see ./examples -$ ghorg clone someorg -$ ghorg clone someorg --concurrency=50 --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2 -$ ghorg clone someuser --clone-type=user --protocol=ssh --branch=develop --color=enabled -$ ghorg clone gitlab-group --scm=gitlab --base-url=https://gitlab.internal.yourcompany.com --preserve-dir -$ ghorg clone gitlab-group/gitlab-subgroup --scm=gitlab --base-url=https://gitlab.internal.yourcompany.com -$ ghorg clone --help -# view cloned resources -$ ghorg ls -$ ghorg ls someorg -``` - ## SCM Provider Setup > Note: if you are running into issues, read the troubleshooting and known issues section below @@ -207,6 +191,23 @@ $ security find-internet-password -s gitlab.com | grep "acct" | awk -F\" '{ pri > It's recommended to store github/gitlab tokens in the osxkeychain, if this command returns anything other than your token see Troubleshooting section below. However, you can always add your token to the $HOME/.config/ghorg/conf.yaml or use the (--token, -t) flags. +## How to Use + +See [examples](https://github.com/gabrie30/ghorg/tree/master/examples) dir for more SCM specific docs + +```bash +# note: to view/set all available flags/features see sample-conf.yaml +$ ghorg clone someorg +$ ghorg clone someorg --concurrency=50 --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2 +$ ghorg clone someuser --clone-type=user --protocol=ssh --branch=develop --color=enabled +$ ghorg clone gitlab-group --scm=gitlab --base-url=https://gitlab.internal.yourcompany.com --preserve-dir +$ ghorg clone gitlab-group/gitlab-subgroup --scm=gitlab --base-url=https://gitlab.internal.yourcompany.com +$ ghorg clone --help +# view cloned resources +$ ghorg ls +$ ghorg ls someorg +``` + ## Changing clone directories 1. By default ghorg will clone the org or user repos into a directory like `$HOME/ghorg/org`. If you want to clone the org to a different directory use the `--path` flag or set `GHORG_ABSOLUTE_PATH_TO_CLONE_TO` in your ghorg conf. **This value must be an absolute path**. For example if you wanted to clone the kubernetes org to `/tmp/ghorg` you would run the following command. diff --git a/examples/github.md b/examples/github.md index d8342fb..e5309c4 100644 --- a/examples/github.md +++ b/examples/github.md @@ -1,18 +1,18 @@ # GitHub Cloud -clone a **users** repos +clone a **users** repos, assumes ghorg conf.yaml is setup with a token ``` $ ghorg clone --clone-type=user ``` -clone an **org** +clone an **org**, using a token on the commandline ``` -$ ghorg clone +$ ghorg clone --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2 ``` -clone all repos from a **github org** that are **prefixed** with "frontend" **into a folder** called "design_only" +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 @@ -23,17 +23,17 @@ $ ghorg clone --match-regex=^frontend --output-dir=design_only clone a **users** repos ``` -$ ghorg clone --clone-type=user --base-url=https://internal.github.com +$ ghorg clone --clone-type=user --base-url=https://internal.github.com --token=bGVhdmUgYSBjb21tZW50IG9uIGlzc3VlIDY2 ``` clone an **org** ``` -$ ghorg clone --base-url=https://internal.github.com +$ ghorg clone --base-url=https://your.internal.github.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://internal.github.com +$ ghorg clone --match-regex=^frontend --output-dir=design_only --base-url=https://your.internal.github.com ```