Search code examples
gitcommittrace

How to know the contributor IP at commit in git


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.


Solution

  • 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.