If you get a "Connection Refused" error message, that (normally) means that no service was listening on IP address + port that your client was trying to connect to.
A common trick for confirming this problem is using some other utility to attempt to connects to the problem IP + port. The telnet
utility is commonly used for this. Install it (if necessary) and check the manual entry to find the command line options for specifying the port number. (It will depend on your OS ...)
Given that you say that localhost works, and the port you are using is not blocked by your local firewall, the most likely explanation is that you have only configured your Git server software to listen on the localhost
IP address (typically 127.0.0.1
)