Git uses ports under the hood when it serves repositories over network protocols. If you run Git over SSH, it defaults to port 22. For HTTP or HTTPS, it uses ports 80 and 443. But when you host and access Git via its native protocol (git://), it listens by default on port 9418. This is the Git internal port — the direct channel to the daemon itself.
Most engineers never see it because SSH and HTTPS dominate. But in private infrastructure, CI/CD pipelines, or high-speed mirroring, the Git internal port matters. It bypasses HTTP overhead and talks straight to the Git daemon. That means faster operations, efficient cloning, and reduced latency.
Security is the trade-off. The Git protocol does not encrypt data or require authentication by default. Exposing port 9418 to public networks is a risk. The best approach is to restrict it to trusted IP ranges, VPNs, or isolated networks. Use firewall rules to control access. Monitor traffic to detect unexpected activity.
When configuring git daemon, you can bind it to a different port using the --port flag: