amitsaha / gitbackup

Tool to backup your Bitbucket, GitHub and GitLab repositories
MIT License
194 stars 33 forks source link

GitLab (custom): Always "Backing up 0 repositores now.." #74

Open duracell opened 2 years ago

duracell commented 2 years ago

Hey, first I want to thanks for this nice tool. I try to backup some repositories in a private GitLab-Installation (which is not hosted by me), but I always get ""Backing up 0 repositores now.." as only response. The permissions should be fine (API+read_*) and if I call it by myself I get a response with the public and my private repositories. There is no difference if I try only to backup private/public/starred repos. With a curl on the API with my PAT I see all my private and the public repos without any problem. Is there any hint someone can give me what could be the problem? I'm using the last binary version on an Ubuntu 18.04 LTS.

Thanks :)

amitsaha commented 2 years ago

Hi @duracell - have you experimented with specifying both these options:

-gitlab.projectMembershipType string
        Project type to clone (all, owner, member, starred) (default "all")
 -gitlab.projectVisibility string
        Visibility level of Projects to clone (internal, public, private) (default "internal")
syphernl commented 2 years ago

I am getting the same with Gitlab: GITLAB_TOKEN=glpat-XXXXXXXXXXXXXXXXXXX gitbackup -gitlab.projectVisibility private -ignore-fork -service gitlab -use-https-clone

This results in the same error as @duracell mentioned:

2022/03/09 09:01:49 Backing up 0 repositories now..

The token has api and read_repository permissions.

With -gitlab.projectMembershipType member or -gitlab.projectMembershipType owner it shows 2022/03/09 09:30:52 Backing up 347 repositories now.. (and 318 if owner) so that seems to be working. However, after a few clones it suddenly starts asking for a username and password which should not be needed because I provided an access token and use -use-https-clone which should be able to use the token to clone the repo. Code-wise it appears this should already be the case yet it doesn't happen.

amitsaha commented 2 years ago

@duracell can you please try the latest release? https://github.com/amitsaha/gitbackup/releases/tag/v0.8.1 @syphernl thanks for the PR again!

aries1980 commented 1 year ago

I have the same experience with v0.9.0 .

amitsaha commented 1 year ago

Hi @aries1980 - can you please share:

  1. Command you are running
  2. Expected result
alex-lechner commented 1 year ago

I have the same problem on MacOS

amitsaha commented 1 year ago

Hi @alex-lechner can you please share:

  1. Command you are running
  2. Expected result