Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

local Netbeans setup with remote git repository

Tags:

git

netbeans

I have a remote production linux web server. On it, I have this setup implemented: I have a prime repository in web root, and hub attached to it. I also have a stagging .dev domain setup for a site, and in the webroot of that domain I have another repository. I push tested changes from it to hub, and then they are automatically pushed to prime. So far so good.

I have two PCs from which I do development (desktop and laptop, both Win). My IDE is netbeans, and I work with remote projects there, over ssh. Everytime the file is edited in netbeans, it automatically uploads it to the stagging repository, so I can test immediately, without any commits. Then when I see the feature is good, I commit, and after testing I push it to hub, then to prime.

This used to be very convinent for me, before I started to work with branches a lot. Everytime I checkout a new branch on the server, I have to re-download the whole project to netbeans, and I often forget to do that. Also when I work from another PC, I sometimes forget to re-download the project also.

I could use WinSCP+Notepad++, as I used to do before, but I'll miss the coolness of netbeans than. I could work via shell and vim all the time, but I'm not cool enough for that. If I set up a local repository, then I'll have to push every change for testing, which is stupid and dirty. Maybe use Dropbox to store a repository and auto-sync? Again, I'm totally satisfied with the server part, the local editing is the problem.

How can you advice me to improve my workflow?

like image 517
Dmitri Pisarev Avatar asked Oct 06 '22 18:10

Dmitri Pisarev


1 Answers

OK, a month later, I'm 100% satisfied with the approach I had taken, and I didn't find any side effects of it.

I put my git repositories in Dropbox folder on the server (Centos). Then, to my local developer machine, these repositories are synced automatically. I open the synced projects with NetBeans, and work locally whether I'm online or not. When I'm online, changes are seamlessly synced to the server, so I can right away see the changes and test on a .dev domain. It takes about 3sec for a small change to be synced with the server.

I can work with git repository either locally via Netbeans, or on the server via command line git. I prefer committing and switching branches on the server, and locally in NB I review the changes, use visual diff etc.

This approach works really great with above mentioned workflow

like image 64
Dmitri Pisarev Avatar answered Oct 10 '22 01:10

Dmitri Pisarev