I have a git repository on my local machine that I push to github and a staging server, which is hosted with HostGator. I followed this guide to setup my staging server to allow me to push to it, which has worked well in the past.
After not pushing anything for about a month, I now see this error when I try to push to the staging server (where [hostname] is replaced with my url):
ssh: connect to host [hostname] port 22: Operation timed out
fatal: The remote end hung up unexpectedly
git remote -v shows:
bright [user]@[hostname]:[path to repo] (fetch)
bright [user]@[hostname]:[path to repo] (push)
origin git@github.com:[reponame.git] (fetch)
origin git@github.com:[reponame.git] (push)
The relevant portion of my .git/config is as follows:
[remote "[remote in question"]
url = [user]@[hostname]:[path to repo]
fetch = +refs/heads/*:refs/remotes/[remote]/*
It may be worth noting that when I ssh into this server, I use port 2222, but as you can see from the error message, git is trying to use port 22. I think that has always been the case though, even when this was working correctly.
What steps can I take to determine why the git push is timing out on my staging server?
Sounds like you may have setup port 2222 in your local
~/.ssh/configfile. Maybe that config was replaced or removed?