Go application that clones or pulls all accessible repositories from various forges
Find a file
2025-06-16 13:26:53 +02:00
.github style(ci): use - instead of _ for sbom filenames 2025-04-24 10:12:42 +02:00
.gitlab feat(ci): move testing and releasing 2025-06-16 13:26:53 +02:00
cmd/gogitlabber feat: version bump to v1.1.5 2025-04-24 10:13:14 +02:00
.gitignore feat: added .ansible to gitignore 2025-06-02 18:38:37 +02:00
.gitlab-ci.yml feat(ci): move testing and releasing 2025-06-16 13:26:53 +02:00
.goreleaser.yaml ci(release): improve release name 2025-04-04 11:39:09 +02:00
go.mod chore(package): update module github.com/scornet256/go-logger to v0.0.2 2025-04-03 15:49:50 +00:00
go.sum chore(package): update module github.com/scornet256/go-logger to v0.0.2 2025-04-03 15:49:50 +00:00
LICENSE feat: added licence 2025-02-27 10:47:55 +00:00
readme.md docs: updated readme after improved output 2025-04-11 17:58:09 +02:00
renovate.json feat: added renovate config 2025-02-27 11:50:02 +01:00

GoGitlabber

This project is inspired from the python application called gitlabber (https://github.com/ezbz/gitlabber). It is mainly to learn Golang. But also to make something that specifically solves my problem. 😆

It is definitely not as feature-rich as the original project... 😬

The program can clone and pull all repositories you have access to on a selfhosted or SaaS provided Gitlab or Gitea server. It only supports the HTTP access method.

It will pull the repositories in a tree like structure same as on Gitlab or Gitea.

root [http://gitlab.example.com]
├── group1 [/group1]
│   └── subgroup1 [/group1/subgroup1]
│       └── project1 [/group1/subgroup1/project1]
└── group2 [/group2]
    ├── subgroup1 [/group2/subgroup1]
    │   └── project2 [/group2/subgroup1/project2]
    ├── subgroup2 [/group2/subgroup2]
    └── subgroup3 [/group2/subgroup3]

Example

Gitea:

$ ./gogitlabber -backend=gitea -destination=$HOME/Documents -git-url=gitea.example.com
-git-api-token=supersecrettoken
 100% [====================] (30/30) [4s] ...   
Summary:
 Cloned repositories: 0
 Pulled repositories: 30
 Errors: 0

Gitlab:

$ ./gogitlabber -backend=gitlab -destination=$HOME/Documents -git-url=gitlab.example.com
-git-api-token=supersecrettoken
 100% [====================] (30/30) [4s] ...   
Summary:
 Cloned repositories: 0
 Pulled repositories: 30
 Errors: 0

Usage

Usage of gogitlabber:
  -archived string
        To include archived repositories (any|excluded|exclusive)
          example: -archived=any
        env = GOGITLABBER_ARCHIVED
         (default "excluded")

  -backend string
        Specify git backend
          example: -backend=gitlab
        env = GOGITLABBER_BACKEND

  -concurrency int
        Specify repository concurrency
          example: -concurrency=15
        env = GOGITLABBER_CONCURRENCY
         (default 15)

  -debug
        Toggle debug mode
         example: -debug=true
        env = GOGITLABBER_DEBUG
         (default false)

  -destination string
        Specify where to check the repositories out
          example: -destination=$HOME/repos
        env = GOGITLABBER_DESTINATION
         (default "$HOME/Documents")

  -git-api-token string
        Specify API token
          example: -git-api=glpat-xxxx
        env = GIT_API_TOKEN
         (default "")

  -git-url string
        Specify Git host
          example: -git-url=gitlab.example.com
        env = GIT_URL
         (default "gitlab.com")

Access Token Permissions

Gitea

Make sure the Gitea Access Token has at least the following permissions:

  • user - read
  • repository - read

Gitlab

Make sure the Gitlab Access Token has the api scope.