user1763581
user1763581

Reputation: 653

GIT, FTP, NetBeans and NetDrive

I've spent long hours trying to figure this out but I just can't get it to work the way I need (maybe what I want is not even possible).

Here is my situation and what I want to achieve: I work in Windows 7. I am developing a website and I am using NetBeans 7.2 to manage my project. The website should be published on a remote webhosting with FTP/FTPS access.

Even though I will be the only one working on this website, I want to use GIT for versioning (I have never used any versioning before), because I want to learn how to work with it and also I will want to develop the website from two different computers (both with NetBeans) so I figure it might really help me.

I believe GIT is supported very well in NetBeans but there are probably still some problems with GIT and FTP. Therefore I installed NetDrive and created a virtual drive for my FTP server under Windows (the virtual drive works well, I can e.g. simply edit the files there and it shows on the web).

I think it is becoming clear what I want to achieve. I read this nice article: http://hoth.entp.com/output/git_for_designers.html and I want to do exactly what is in Figure 2 in that article.

I also read this NetBeans GIT tutorial: http://netbeans.org/kb/docs/ide/git.html

So I created a NetBeans project on my new virtual drive (that represents the FTP server), initialized a GIT repository and performed the first commit (all with NetBeans menus).

Then I cloned the GIT repository to a local directory and created a NetBeans project in that directory. The cloning went well and I had the files in my local directory so I could edit them.

After editing and commiting a file, I tried to push the repository back to the virtual drive (FTP server) via menu GIT-Remote->Push. I could see the original repository in the dropdown menu there (origin:file:///my_virtual_drive_and_path_to_the_directory). So I clicked Next, selected the branch... And according to the Output, everything went fine.

But the actual files on my virtual drive (FTP server) just didn't change! The GIT repository version changes, but the files on server just remain as they were before I edited them.

If this all worked, I would also install NetDrive on my other computer, create a virtual drive for my FTP server there, clone the GIT repository and I would be able to work on the project from my other computer with the help of GIT versioning. Then I would only be "pushing" and "pulling" and I would be happy.

But now my head is about to explode. Please tell me if what I want is possible, if I am taking the right direction and where I am making mistakes.

Thank you.

Upvotes: 3

Views: 1337

Answers (2)

Chronial
Chronial

Reputation: 70673

You have a misconception about how pushing works / what it does. Pushing updates the repo content/history, not the checkout out working copy. As this leads to confusing situations (you might have noticed ;), you usually don’t push to a repo that has a working copy.

But in your case that’s obviously part of you system, but you need to set up git so this works. See here for descriptions how to that: Deploy a project using Git push

Upvotes: 1

DWright
DWright

Reputation: 9500

Basically, it looks like your push isn't resulting in a checkout. Take a look at http://toroid.org/ams/git-website-howto, which might help.

Upvotes: 1

Related Questions