1

I have some private repos on gitlab. If someone happen to know my repo address, will they be able to clone them? I suppose they can't, but what prevent them from cloning? Every time when I clone a repo, no user name nor password is required.

an offer can't refuse
  • 4,245
  • 5
  • 30
  • 50

2 Answers2

3

There a two ways to clone a repository.

  1. Over HTTP
    git clone https://gitlab.com/username/reponame.git
  2. Over SSH
    git clone git@gitlab.com:username/reponame.git

The first one viz. http method will ask you for your credentials and would fail if you provide incorrect details. The second one viz. SSH method does not require a username/password prompt and will clone the repo without any further action. This method only works if you have added the ssh key of the machine from which you are cloning to the associated Gitlab/Github account.

So to answer you question, will someone be able to clone your repo if they know your repo address?

The answer is a No and Yes. No, one wont be able to clone your repo just by your repo address. Yes, If they can get access to a machine, whose ssh key is associated to your Gitlab account, they would be able to clone your repo without requiring any username/password.

vishnu narayanan
  • 3,813
  • 2
  • 24
  • 28
0

Private repos can only be cloned by your SSH, and the methods are shown here: How can I clone a private Gitlab repo?

Huy Vo
  • 2,418
  • 6
  • 22
  • 43