Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ CLI Usage is as follows::
directory at which to backup the repositories
--prefer-ssh Clone repositories using SSH instead of HTTPS
--skip-existing skip project if a backup directory exists
--with-membership Backup projects provided user or key is member of


.. |PyPI| image:: https://img.shields.io/pypi/v/gitlab-backup.svg
Expand Down
6 changes: 5 additions & 1 deletion bin/gitlab-backup
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,10 @@ def parse_args():
action='store_true',
dest='owned_only',
help='Only backup projects owned by the provided user or key')
parser.add_argument('--with-membership',
action='store_true',
dest='with_membership',
help='Backup projects provided user or key is member of')
return parser.parse_args()


Expand All @@ -343,7 +347,7 @@ def main():
log_info('Create output directory {0}'.format(output_directory))
mkdir_p(output_directory)

items = client.projects.list(as_list=False, owned=args.owned_only)
items = client.projects.list(as_list=False, owned=args.owned_only, membership=args.with_membership)
repositories = {}
for item in items:
repositories[item.path_with_namespace] = item
Expand Down