Search code examples
linuxgitftpworkflowgedit

Is there an ftp plugin for gedit that will let me work locally?


I'm trying to switch from a windows environment to Linux. I'm primarily PHP developer, but I do know quite a bit about other languages such as CSS, XHTML and Javascript. I need a way of editing my files locally because I work in a git repository and need to commit my saves. On windows I used Aptana and PDT. I'd save my files, upload via Aptana, then commit my work with git.

I need to get a work flow going on my Linux machine now. If you know a better way to do this let me know, however my real question is, is there a plugin that allows gedit to upload files instead of working remotely?


Solution

  • git was designed for distributed development and works well as a mechanism for deploying code to a web server.

    On your Linux PC, git clone your git repository url. Edit and commit locally and then git push the changes to the git repository. Then, if you have shell access on the server, use git pull to copy the changes to your server.

    To ftp sync, you could set up a branch, ftpbranch, that corresponds to what is on the server, and then each time you want to sync ftpbranch with master:

    filestoput=`git diff --name-only master ftpbranch`
    

    Now upload the files:

    for f in $filestoput; do curl --ftp-create-dirs -T $f ftp://serverurl
    

    Now update ftpbranch indicating these files have been copied to the server:

    git checkout ftpbranch; git merge master; git checkout master