3

I am a beginner to start with git. I have created my account on github. I created a new repository. But I am not able to push or update changes in github using the terminal. I am running the following commands:

mkdir ~/TestApplication
cd ~/TestApplication
git init
touch README
git add README
git commit -m 'first commit'
git remote add origin https://github.com/vinayptl/TestApplication.git
git push origin master

When I execute last command git push origin master, it freezes for some time and give following error:

error: Failed connect to github.com:443; Connection timed out while accessing 
https://github.com/vinayptl/TestingApplication.git/info/refs

fatal: HTTP request failed

I am working on Linux Platform. What could be the problem? I have seen some of the answers from SO but not able to resolve this issue.

petrichor
  • 6,459
  • 4
  • 36
  • 48
vinay patel
  • 177
  • 3
  • 5
  • 10
  • Does this [repository exist on github yet](http://stackoverflow.com/questions/4658606/import-existing-source-code-to-github)? Have you successfully checked out a repo from github on this machine (i.e. are your ssh keys setup correctly)? – hafichuk Jan 07 '13 at 14:52
  • i just have started using github and yes this repository exist on github. i am just following the steps given in https://help.github.com. so i have not setup ssh connection but here i am using HTTP for connection – vinay patel Jan 07 '13 at 14:59
  • You could try the SSH URL to see if that works: `git remote set-url origin git@github.com:username/TestApplication.git`. – Fred Foo Jan 07 '13 at 15:04
  • no its not working. is it some firewall issue – vinay patel Jan 07 '13 at 15:11
  • `curl -v https://github.com/vinayptl/TestingApplication.git/info/refs` might shed some light on that. Also `ping -c1 github.com` to just double-check that it actually is going to github (I get `207.97.227.239`). – hafichuk Jan 07 '13 at 15:55
  • When I tried to clone that repo, it asked for username and password, which I can only assume means that "it works" - since I don't know those details, I couldn't go fruther... – Mats Petersson Jan 07 '13 at 20:17
  • ping -c1 github.com is failing.I am not able to connect to github server(207.97.227.239). – vinay patel Jan 08 '13 at 04:15

1 Answers1

2

If you have a proxy in place, ping won't help you much (it cannot ping through proxy).

You need to set http_proxy and https_proxy environment variable.
See:

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