Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Push changes from Eclipse PDT to production server with EGit (FTP like)

I'm totally new to Git, so I figured I'll have more luck with EGit since I'm using Eclipse PDT. I'm the only programmer on the project. Here's what I'm doing right now:

  1. I have two identical copies of website on my local machine and server
  2. I'm making changes to the local version, testing, debugging etc.
  3. When I'm satisfied with the code, I open FileZilla and upload each and every file I have changed

What I would like to do is: ... 3. Commit changes 4. Push changed files (those I have dragged to Staged Changes) to the production server

So, this looks like very simple request. I don't want Git installed on the server, .git folder on the server etc. I just want to push new and changed files to the server, overriding those that are already on the server. I suppose this is possible, because when I right click the project and go to Team > Remote > Push..., there is a sftp option for the Protocol.

How can I achieve this? What would the input on the form I've mentioned (Team > Remote > Push...) look like? Or am I wrong, and I must install Git on the server?

Can EGit be used as SFTP client?

My only knowledge of Git is from this tutorial: http://www.vogella.com/articles/EGit/article.html. I've searched StackOverflow, but every topic is way to "Git specific" and way beyond my knowledge, so I don't understand most of it.

Thanks in advance.

like image 274
user1683342 Avatar asked Sep 19 '12 14:09

user1683342


2 Answers

I'm not sure if it will work but maybe you can use export feature (File->export->Remote System->Remote file system). I think to use this feature you have to install RSE (Remote System Explorer). This should export clean project, without .git folder.

like image 78
Marek Maksimczyk Avatar answered Nov 15 '22 04:11

Marek Maksimczyk


The sftp protocol you see is just a protocol for git to connect to another computer having a git repository. So no luck for that.

You cannot achieve that workflow with only a git command. When creating a git server, called a bare repository, the layout on the filesystem does not reflect the files of your project but git's internals. So when you push your changes to the bare repository, you indeed send the files to the it but in order to "see" those files, you need to clone it.

The easiest way to do step 3 would be to create a script to upload your files using ftp, instead of doing the procedure manually. So no git bare repository on the server is needed.

There are also other nice workflows involving installing git on the server FYI.

like image 31
ibizaman Avatar answered Nov 15 '22 04:11

ibizaman