简体   繁体   English

如何在git中知道贡献者IP

[英]How to know the contributor IP at commit in git

I am running a PHP project and that is using git at code-base. 我正在运行一个PHP项目,并且在代码库中使用git。 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. 如果他们从其他位置/ IP访问,那么我想知道该IP。 Now how can I know that? 现在我怎么知道呢?

FYI, I am talking about the private repository. 仅供参考,我在谈论私有存储库。

Git is a decentralized repository. Git是一个去中心化的存储库。 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. 因此,您无法使用Git在这两个位置强制使用项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM