Skip to content

Commit

Permalink
Update README.rst
Browse files Browse the repository at this point in the history
Update usage
  • Loading branch information
ezbz authored Jul 1, 2024
1 parent 1223e1c commit 59acf83
Showing 1 changed file with 36 additions and 36 deletions.
72 changes: 36 additions & 36 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
.. image:: https://readthedocs.org/projects/gitlabber/badge/?version=latest&style=plastic
:target: https://gitlabber.readthedocs.io/en/latest/README.html


Gitlabber
=========

Expand Down Expand Up @@ -85,62 +86,61 @@ Usage

.. code-block:: bash
usage: gitlabber [-h] [-t token] [-u url] [--verbose] [-p] [-d]
[--print-format {json,yaml,tree}] [-m {ssh,https}] [-i csv]
[-x csv] [--version] [-g {id,full_path,full_name}]
[dest]
Gitlabber - clones or pulls entire groups/projects tree from GitLab
usage: gitlabber [-h] [-t token] [-T] [-u url] [--verbose] [-p] [--print-format {json,yaml,tree}] [-n {name,path}] [-m {ssh,http}] [-a {include,exclude,only}] [-i csv] [-x csv] [-r] [-F] [-d] [-s] [--version]
[dest]
Gitlabber - clones or pulls entire groups/projects tree from gitlab
positional arguments:
dest destination path for the cloned tree (created if doesn't exist)
optional arguments:
-h, --help show this help message and exit
-t token, --token token
dest destination path for the cloned tree (created if doesn't exist)
options:
-h, --help show this help message and exit
-t token, --token token
gitlab personal access token https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html
-u url, --url url base gitlab url (e.g.: 'http://gitlab.mycompany.com')
--verbose print more verbose output
-p, --print print the tree without cloning
--print-format {json,yaml,tree}
-T, --hide-token use an inline URL token (avoids storing the gitlab personal access token in the .git/config)
-u url, --url url base gitlab url (e.g.: 'http://gitlab.mycompany.com')
--verbose print more verbose output
-p, --print print the tree without cloning
--print-format {json,yaml,tree}
print format (default: 'tree')
-n {name,path}, --naming {name,path}
the folder naming strategy for projects (default: "name")
-m {ssh,http}, --method {ssh,http}
-n {name,path}, --naming {name,path}
the folder naming strategy for projects from the gitlab API attributes (default: "name")
-m {ssh,http}, --method {ssh,http}
the git transport method to use for cloning (default: "ssh")
-a {include,exclude,only}, --archived {include,exclude,only}
-a {include,exclude,only}, --archived {include,exclude,only}
include archived projects and groups in the results (default: "include")
-i csv, --include csv
-i csv, --include csv
comma delimited list of glob patterns of paths to projects or groups to clone/pull
-x csv, --exclude csv
-x csv, --exclude csv
comma delimited list of glob patterns of paths to projects or groups to exclude from clone/pull
-r, --recursive clone/pull git submodules recursively
-T, --hide-token hide the token from the gitlab request URL (for method: http)
-f, --use-fetch clone/fetch git repository (mirrored repositories)
-s, --include-shared include shared projects in the results
--version print the version
-r, --recursive clone/pull git submodules recursively
-F, --use-fetch clone/fetch git repository (mirrored repositories)
-d, --dont-checkout don't checkout pulled git repository
-s, --include-shared include shared projects in the results
--version print the version
examples:
clone an entire gitlab tree using a base url and a token:
gitlabber -t <personal access token> -u <gitlab url> .
# the following examples assume you provided token/url in environment variables so these arguments are omitted
clone an entire gitlab tree using a url and a token:
gitlabber -t <personal access token> -u <gitlab url>
only print the gitlab tree:
gitlabber -p .
clone only projects under subgroup 'MySubGroup' to location '~/GitlabRoot':
gitlabber -i '/MyGroup/MySubGroup**' ~/GitlabRoot
clone only projects under group 'MyGroup' excluding any projects under subgroup 'MySubGroup':
gitlabber -i '/MyGroup**' -x '/MyGroup/MySubGroup**' .
clone an entire gitlab tree except projects under groups named 'ArchiveGroup':
gitlabber -x '/ArchiveGroup**' .
clone projects that start with a case insensitive 'w' using a regular expression:
gitlabber -i '/{[w].*}' .
Debugging
---------
* You can use the `--verbose` flag to print Gitlabber debug messages
Expand Down

0 comments on commit 59acf83

Please sign in to comment.