-1

I have installed git-bash on my laptop and trying to push my project on my GitHub account, but it shows this:

$ git push -u origin main fatal: unable to access 'https://github.com/user_name/repo_name.git/': 
Could not resolve host: github.com

I have tried the command several times and checks other things. Sometimes I found, this command made the bash screen stuck, doing nothing. -_-

I have tried this command to ensure that the remote is correct:

$ git remote -v

and get this:

origin  https://github.com/user_name/repo_name.git (fetch)
origin  https://github.com/user_name/repo_name.git (push)

I checked my username and email in git config using:

$ git config user.email
$ git config --global user.password

Found all this stuff ok what I have tried.

amJayem
  • 37
  • 1
  • 4

1 Answers1

0

You might need to define HTTP_PROXY/HTTPS_PROXY environment variables, if you are behind a proxy, as I did here.
Or the opposite: you have the wrong proxy specified in Git:

git config --global --unset https.proxy

Or, depending on your situation:

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250