Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to make git repository browsable but not clonable?

Tags:

git

github

gitlab

I would like to potentially show some of my works to future prospective employers. But I do not necessarily want them to just clone and take my work and develop from it. My work is currently just a few HTML & CSS projects, I don't want them to just clone it and develop from it. I would like them to just be able to see the code and possibly also my commit histories (via a browser on gitlab.com website).

I know that they could inspect and view source or even save the page while viewing the website, but I guess everyone could do that to any website. But the work is considered a little bit more demanding than just cloning a project and fork another project from it.

If I make my GitLab repository public, everyone can clone and fork from it.

Is it possible that I can make it public (browsable via Gitlab website), but disable the git:// protocol and also other methods to anonymously clone from it?

like image 665
K4ll-of-D00ty Avatar asked Sep 17 '25 15:09

K4ll-of-D00ty


1 Answers

No, there is no way to prevent people from cloning or downloading your repository if they have access to it.

If you are worried about others using your code without your express permission, I would suggest adding a license. License protects you legally and gives you control over your codebase.

You can visit this site to help to decide which license to use.

Alternate Solution

If you just want to show your codebase and don't care/want open-source-iness. You can try following,

  • ZIP or RAR your repository
  • Put it on google drive
  • Get a shareable link
  • Click advanced - Check to prevent people from downloading or sharing the file

Anyone with the link can see what's inside the directories and the structure, but can't open or view the content of the files. They will not be able to download as well.

like image 139
Gaurav Gandhi Avatar answered Sep 19 '25 06:09

Gaurav Gandhi