github push-ing behind draconian proxies!

git remote add origin git@SSH-HOST:<USER>/<REPOSITORY>.git
If you are behind a restrictive proxy/firewall that blocks port 22 connections but allows SSL on 443 (like most do) then you can still push changes to your github repository. Your .ssh/config file should contain: Host * ForwardX11 no TCPKeepAlive yes ProtocolKeepAlives 30 ProxyCommand /usr/local/bin/proxytunnel -v -p -d %h:443 Host User git Hostname ChallengeResponseAuthentication yes IdentityFile ~/.ssh/id_rsa IdentitiesOnly yes Basically proxytunnel "tunnels" your ssh connection through port 443. You could also use corkscrew or some other tunneling program that is available in your distro's repository. PS: I generally use "" as the SSH-HOST so that urls of the kind work transparently :) You

By: jnash
2009-11-19 06:57:50

These Might Interest You

  • After cloning an empty repository on the client ("git clone" just after "git init", for instance), "git push" fails. In order to be able to push to this repository for the first time, you need to run the above command. It will link your local "master" branch to the "master" branch in the origin server, and push the changes. This is only necessary only for the first push; after that, you can use just the commands "git push" or "git pull" in order to do this operations. Show Sample Output

    git push --set-upstream origin master
    quitaiskiluisf · 2017-01-09 00:32:14 0
  • Maybe this will help you to monitor your load balancers or reverse proxies if you happen to use them. This is useful to discover TIME OUTS and this will let you know if one or more of your application servers is not connected by checking. Show Sample Output

    watch -n 1 "/usr/sbin/lsof -p PID |awk '/TCP/{split(\$8,A,\":\"); split(A[2],B,\">\") ; split(B[1],C,\"-\"); print A[1],C[1],B[2], \$9}' | sort | uniq -c"
    ideivid · 2011-08-12 19:16:38 0
  • Written for Mac OSX. When you are working in a project and want to open it on, just type "gh" and your default browser will open with the repo you are in. Works for submodules, and repo's that you don't own. You'll need to copy / paste this command into a file, then create an alias in your bash or zsh profile to the script. Detailed instructions here if you still need help:

    git remote -v | grep fetch | sed 's/\(.*\)[:|/]\(.*\).git (fetch)/\2/' | awk {'print "" $1'} | xargs open
    brockangelo · 2012-04-15 20:48:46 1

  • -2
    git push origin --all
    takeshin · 2011-06-11 09:24:42 0

What Others Think

At least in debian/ubuntu 'man ssh_config' reveals all the other options you can use. When I check out an svn+ssh:// url I sometimes need to specify an alternate SSH port, and ~/.ssh/config is the only way to do this, since the svn command line client doesn't accept port numbers in the repository url.
bwoodacre · 447 weeks and 6 days ago

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this? is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands

Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.


Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: