0

I am running a PHP project and that is using git at code-base. My programmers work at office as well as home. I want to make sure that they can only use this code base from these two location.

If they access from different location / IP then I want to know that IP. Now how can I know that?

FYI, I am talking about the private repository.

naf4me
  • 403
  • 7
  • 17

1 Answers1

4

Git is a decentralized repository. Each client owns a full clone of the repository. Once I cloned the repository from a trusted location, there is no way for you to prevent me to continue to work on the repository locally, and commit new changes.

The only connection you can monitor is the push/pull phase from the local repository to a remote repository. But apart from that, you have no other control. Therefore, you have no way to enforce the use of your project in those two locations using Git.

Simone Carletti
  • 173,507
  • 49
  • 363
  • 364
  • Someone can do anything with a cloned repository. But when s/he commit to my private repo then I may ask for who and from where is committing. – naf4me Mar 25 '15 at 10:50
  • Yes, but he can commit the changes from an untrusted IP, then push the changes from a trusted IP. – Simone Carletti Mar 25 '15 at 10:55
  • Yes, commit may be from un-trusted IP and when it is pushed then it has trusted IP. Can I track this trusted IP? If yes please tell me the way. – naf4me Mar 25 '15 at 11:14
  • It depends on how where your Git central repository is located. Place it in a system you can control, and you'll be able to manage the HTTP/SSH connection Git uses to connect to your server. – Simone Carletti Mar 25 '15 at 12:27