TXT
Reply to comment
How to devel with a remote repository over ssh
Submitted by enzo on Thu, 06/04/2009 - 21:09Sometimes we could find some projects with repositories remotes and the developers needs to modify the files directly in this file system, in order to test in their dev web space i.e http://www.user.dev
If developers has a good bandwith to work with a remote file system as local we will use the option # 1 described below.
These instructions will work in Ubuntu and Debian O.S if you have a different O.S you must look up a similar services and programs
Network File System Over SSH
Install Packages
#sudo apt-get install fuse-utils sshfs
Add your use to fuse group
sudo adduser [your-user] fuse
Create a local folder
#mkdir ~/local-folder
Mount the system
#sshfs [your-user]@remote-server:remote-folder ~/local-folder
Just in case your bandwidth won't enough to support developing using a Network File System you must use the option # 2 described below
Sync remote repositories using rsync
This option enable the possibility to maintain a local copy of files (NOT Database or Web Server)m in order to enable a quick edition.
Install Packages
#sudo apt-get install rsync
rsync Options
--delete deletes files that don't exist on the system being backed up.(Optional)
-a preserves the date and times of the files (same as -rlptgoD).
-z compresses the data
-v verbose
-vv increases the verbosity of the reporting process
-n For testing Dry-run
-C ignore CVS and Subversion folder/files
-e specify the remote shell to use
Get local copy
#rsync -vz -C -e ssh your-user@remoteserver:/remotefolder ~/localfolder
Push changes
#rsync -vz -C -e ssh ~/localfolder your-user@removeserver:/remotefolder
Aliases in .bashrc
pull='rsync -vz -C -e ssh rob@rob.dev:/var/webdev/sites/dev/rob/ ~/workspace/us.rob.dev'
push 'rsync -vz -C -e ssh ~/workspace/us.rob.dev rob@rob.dev:/var/webdev/sites
Doesn't matter if you choose option # 1 or option # 2 you are able now to edit the code and create a project using your favorite IDE like netbeans or Eclipse PDT
Enjoy IT.

