Skip to content

Instantly share code, notes, and snippets.

@codeincontext
Created December 14, 2012 15:36
Show Gist options
  • Save codeincontext/4286311 to your computer and use it in GitHub Desktop.
Save codeincontext/4286311 to your computer and use it in GitHub Desktop.
ssh into the same directory on the server as your local working directory. If you're in /Users/skattyadz/Dropbox/code/instawall, it will ssh in and "cd instawall"
# add to ~/.bash_profile
function sshh() {
local PROJECTNAME=${PWD##*/}
local HOST=$1
eval "ssh -t ${HOST} \"cd ${PROJECTNAME}; bash\""
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment