Git through SSH port forwarding (SSH tunneling)

Scenario:

A.  you are on a firewalled network, from where you can’t access github (remote port:9418 is not allowed)

or

B. you want to access a securized git server from home, but your IP is not on the git server’s whitelist.

and, of course, you have ssh access on a server that can do this.

 

A. Make a ssh tunnel to the git server

Me –> ServerWithSSHAccess –> GitServer

Continue reading

Capistrano – deploy to specific revision (= tag, branch, hash)

To deploy something other than the HEAD, you must use the -s option.

Below are examples for git.

cap -s branch=my_branch deploy

cap -s tag=my_tag deploy

Git push error (fatal: protocol error: expected sha/ref, got’)

Problem: forked a project from Git, made some changes, wanted to push the changes. Got this error:

git push
fatal: protocol error: expected sha/ref, got ‘
*********’

You can’t push to git://github.com/user/repo.git
Use git@github.com:user/repo.git

Continue reading