views:

354

answers:

2

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?

A: 

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
Jamey Hicks
Yes I know how to use git. I'm talking about ftp syncing without git+ssh.
Robert Hurst
never mind lol I'll just setup a local php server
Robert Hurst
A: 

When using linux, you can mount the ftp server to a local folder, then opening and save file from that folder will automatically download and upload the file to ftp server.

If you use ubuntu, just click on Places > Connect To Server.... Choose FTP in Service Type dropdown, fill in the required info, then don't forget to bookmark it.

After this, you can open the file directly in any text editor, not just gedit. I would recoment geany for serious programming editor, because it have a lot of neat feature, almost same with Notepad++ in Windows.

But, since you already using git, why not just use git push to get the update and git pull to upload the update? I have long since uploading manually to my server. Git do all the work for me, synchronizing it between servers. Any particular reason why you still need ftp?

Donny Kurnia