copy and pasted from a slack chat. Special shoutout to Anthony L. for the tip!
here’s a time saver i just drummed up that’s worthy of sharing. it will be of interest to you:
in your ~/.ssh/config
put:
1 2 3 4 |
Host ec2-* User ubuntu IdentityFile /path/to/your/private_key.pem RemoteForward 55555 localhost:22 |
look mom, no hands! now, any time you log into an EC2 node, there’s a convenient reverse tunnel to your dev box and all you have to do is ssh ec2-node-fqdn
from your workstation,
Once on the node, you can do the following:
1 |
git checkout ssh://yourworkstationuser@localhost:55555/home/yourusername/src/anygitrepo |
boom! you can edit files on your workstation and then, rather than push them to master/dev, just pull the changeset on the dev ec2 node naturally with a git pull
and you’re up-to-date and ready to test on!