2

I use git with gitlab.

I'm no longer able to push to my repo from windows pc. git is no longer asking for password.

The error:

achita@DESKTOP-IAEDBE2 MINGW64 /c/RachitaData/Git/Projects/Pms (master)
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean

Rachita@DESKTOP-IAEDBE2 MINGW64 /c/RachitaData/Git/Projects/Pms (master)
$ git push -u origin master
fatal: unable to access 'https://gitlab.com/aarfid/aarfidProjects.git/': Failedto connect to gitlab.com port 443: Bad access

EDIT

Ping command cannot find host

 ping https://gitlab.com/aarfid/aarfidProjects.git
    Ping request could not find host https://gitlab.com/aarfid/aarfidProjects.git. Please check the name and try again.

C:\Users\Rachita\Downloads\curl-7.33.0-win64-ssl-sspi>ping gitlab.com

Pinging gitlab.com [104.210.2.228] with 32 bytes of data:
Request timed out.

Ping statistics for 104.210.2.228:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),
Control-C
^C

Curl

    C:\Users\Rachita\Downloads\curl-7.33.0-win64-ssl-sspi>curl https://gitlab.com/aarfid/aarfidProjects.git
    curl: (7) Failed connect to gitlab.com:443; No error

C:\Users\Rachita\Downloads\curl-7.33.0-win64-ssl-sspi>curl gitlab.com
curl: (7) Failed connect to gitlab.com:80; No error

Although I'm able to open gitlab.com on the browser

EDIT1

firewall settings

C:\Users\Rachita\Downloads\curl-7.33.0-win64-ssl-sspi>netsh advfirewall show currentprofile

Private Profile Settings:
----------------------------------------------------------------------
State                                 ON
Firewall Policy                       BlockInbound,AllowOutbound
LocalFirewallRules                    N/A (GPO-store only)
LocalConSecRules                      N/A (GPO-store only)
InboundUserNotification               Enable
RemoteManagement                      Disable
UnicastResponseToMulticast            Enable

Logging:
LogAllowedConnections                 Disable
LogDroppedConnections                 Disable
FileName                              %systemroot%\system32\LogFiles\Firewall\pfirewall.log
MaxFileSize                           4096

SOLUTION

I turned off the firewall and the problem was solved as suggested by das_j in comment

To turn wirewall off

netsh advfirewall set allprofiles state off
Rachita Nanda
  • 4,509
  • 9
  • 42
  • 66

3 Answers3

3

turned off the firewall and the problem was solved as suggested by das_j in comment

To turn wirewall off

netsh advfirewall set allprofiles state off
Rachita Nanda
  • 4,509
  • 9
  • 42
  • 66
  • 2
    You have very impressive solution! totally disable firewall to just be able to push to git and expose your computer to network. I guess firewall was there for a reason. – AaA Feb 16 '21 at 10:11
  • @AaA was that sarcasm? Confusing for the newbies. – carloswm85 Jul 07 '21 at 15:23
  • 2
    @carloswm85, yes it was! You should be adding git port and IP to firewall instead of totally disabling it unless you are looking for a new home for some ransomware and computer viruses! – AaA Jul 13 '21 at 17:02
  • @AaA ok, good to know. Thanks for the clarification. I need to read more about how firewalls work. – carloswm85 Jul 13 '21 at 20:07
2

There was days that you only needed to protect your PC from incoming connections, nowadays there is almost no threat from incoming connection, there is only outgoing that you have to block.

I have Firewall blocked all outgoing connections by default, unfortunately windows firewall log is completely useless (never writes anything at least for my windows 10, in few machines) I had to install another firewall and disable windows firewall to see what program actually trying to connect out during push.

Here are 3 that I needed to allow access

port 53 and 443 for git-credential-manager-core.exe

  • selected during install otherwise git-credential-manager.exe)

port 53 and 443 for git-remote-https.exe

  • If you are using https git repo url otherwise git-remote.exe or any of the others depending on your protocol, there are a few of them.

port 443 and 53 for TortoiseGitProc.exe

  • Since I am using TortoiseGit too, if you are using command line or different GUI (e.g. source tree) try finding the process for that.

Note: all these exe files are in Git\mingw64\libexec\git-core\ folder

AaA
  • 3,600
  • 8
  • 61
  • 86
  • Let's say I'm behind a proxy, how should I apply this solution? – carloswm85 Jul 07 '21 at 15:25
  • is your proxy behind the firewall or inside? you can ask the person who setup the proxy to open the firewall for you, but I don't think they have put proxy and then block it with firewall. As for git to connect through proxy there is a small config help in here https://gist.github.com/evantoli/f8c23a37eb3558ab8765 Also the above solution only applies if your git is blocked by firewall, specifically windows firewall. – AaA Jul 13 '21 at 16:59
1

Use Vpn Enable local network in your Vpn client settings and make sure you can telnet to the 443 port on the URL. double check if you want to connect to github or gitlab.

Muhammad Usman
  • 357
  • 2
  • 14