This Question is Possibly Answered

1 "correct" answer available (4 pts) 2 "helpful" answers available (2 pts)
1 Replies Last post: Aug 16, 2013 12:06 AM by Deric Hicks  
Jim Lahm Newbie 9 posts since
Oct 21, 2010
Currently Being Moderated

Aug 15, 2013 10:10 PM

GIT setup with remote server

I currently have my files located on a remote Linux server that I can access via a mounted folder. Of course, I also have a copy of all of the files on my local PC for PhpSorm to operate on. When I set this up, I created a GIT repository on my remote server (cloned from the master on BitBucket.org). I am wondering if this is the "proper" approach, or whether I am better served making the GIT repository be on my local PC with a copy of the files on the remote server? Or, should I just have a GIT repository in both places? I am not a GIT expert, so I am looking at what the best approach would be to using GIT in a development environment with PhpStorm on my PC and a remote server running Apache..

 

I have downloaded a nice GIT GUI (SourceTree) and tried it using my current configuration. It is quite slow when working on the remote server using my mounted folders. However, when I put the same repository on my local PC it is very fast, which is why I started thinking about chaning my approach.

 

Any help would be appreciated!

 

Jim

Deric Hicks Newbie 31 posts since
Dec 29, 2011
Currently Being Moderated
Aug 16, 2013 12:06 AM in response to: Jim Lahm
Re: GIT setup with remote server

I typically setup clones on both my development server and my local box.  I can test via regular SFTP and make sure I'm happy, then commit locally.  When I feel it's ready for true alpha testing, I run git clean -fd and git reset --hard and git pull on the development box.  If everything still looks good that means the code I committed is working properly.  After that your workflow may vary, but I have a staging server for my clients, and I'll typically pull it up there and make sure they're happy, then do the final merge and call it done.

 

Using a centralized repository hub like BitBucket makes it pretty simple since both clones point to the same place.  Just create yourself a single remote branch, check it out locally and track it on your dev server and your local environment, and you're good.

 

Your mileage may vary, but it's been working for me for a long time

More Like This

  • Retrieving data ...