Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I whitelist IPs to work on my Git repo?

Tags:

git

github

ip

I want my Git repos to be setup only on particular desktops/laptops. Any good way to pursue that?

like image 680
Abhas Avatar asked Oct 15 '25 19:10

Abhas


2 Answers

git does neither know something about authorization nor about authentication.

What you are trying is not possible with git.

BUT you can use some tools like gitolite to set up something similar based on ssh-keys. If your really want to restrict access also by IP you need something like a firewall on a server where the repo was intialy created.

like image 107
ckruczek Avatar answered Oct 18 '25 10:10

ckruczek


Github's business model is that you can have public repos for free, but you need to have a payed subscription to have private repos.

Whitelisting IPs is not a good idea. The IP address of a typical home internet connection may change anytime the ISP wants it to change and enterprises will have many hundred or thousand users behind a single public IP. Both ways you will have problems allowing the proper user to a specific repo.

You might have a look at Git hosting services that offer private repos with authentication (free).

like image 20
karatedog Avatar answered Oct 18 '25 10:10

karatedog