Setup working environment with git

Hi there.

I'm working on Windows 7 with phpstorm and I've got a ubuntu server on which I have my repository.
Now I would like to have a clone to work on it. But if I clone my repository to the windows computer, git will copy all files in a windows directory.
So I can't test my changes localy!

I could setup a linux-emulation like Xamp /CentOS or something. Is this practical? Or would it be much better to work directly on my local server and
commit my local changes from my /home/workspace to the origin/master on the Ubuntu-Server??
umgebung.png
Thank you for any hint

7 comments
Comment actions Permalink

Don't understand what you mean by "So I can't test my changes localy!".


How I have mine setup.
* repository is on bitbucket.
* local developement system runs phpstorm. (pc #1)
* local server runs ubuntu server (pc #2)

- use the auto upload to FTP any files you change to the local server.
- view the changes in a browser on the local server.
- commit changes to local git (pc #1 same one thats running phpstorm)
- make changes
- commit changes
- make changes
- commit changes
- (end of day) push changes to bitbucket.

Next day:
- (beginning of day)  pull from bitbucket to get anybody elses changes
- deploymnet -> "Deploy with ..." (choose local server)

local server and phpstorm are now in sync.  repeat the "make changes" / "commit changes" cycle.

0
Comment actions Permalink

okay Thanks. Thats sounds good.

by saying: "So I can't test my changes localy!" I mean each changes should be testable immediately.

"use the auto upload to FTP any files you change to the local server".

How to set this up?

Thank you

Michael

0
Comment actions Permalink

The changes are only going to be testable immediatly if you have a webserver running.

The auto-upload is under TOOLS -> DEPLOYMENT -> "Automatic upload (always)"

and sync with server is under:
(PROJECTS pane ) -> right click -> DEPLOYMENT -> Sync with Deployed to xxxxx.xxx

0
Comment actions Permalink

Thank you Michael.

Could you please tell my which way you decided to setup a new Peoject in phpstorm?

Create New Project from existing Files? Or ...?

Michael

0
Comment actions Permalink

I have done it like this.

First I have defined my folder as repository on the unbuntu server. git init and git add .

After this I install a clone on an other directory on this server.

After this a crat a new project with phpstorm by connect via sftp to the local clone on my local server.

But now I don't know how to set up my phpstorm so when I have change a file with phpstorm
it should be commited to the cloned projektfiles and with push this changed files should be merged with
my original repository...

I'm a very first beginner and there is no good documentation for this case.

From the other side I don't want to install Xamp or centOS on my windows system.. is this possible??

Please lend me a hand for this f+++cking setup ;-)

Michael

0
Comment actions Permalink

To setup a completly new project in phpstorm i do this:
* FILE -> OPEN DIRECTORY -> click the new folder icon and give it a name.

Thats the new project directory.  Then add it to git:
* VCS -> ENABLE VERSION CONTROL FOR THIS PROJECT -> GIT

Then in the CHANGES panel under "unversioned files" i click the (folder) icon so all folders are grouped.  Right click on /.idea and select "IGNORE -> IGNORE ALL FILES UNDER /.idea".

You dont want /.idea getting into your version control.

Next I setup the remote server.
* TOOLS -> DEPLOYMENT -> CONFIGURATION

Add the details to connect your local remote server and go to MAPPINGS tab and check "use  this server as default".
* click OK.

Next re-open the tools and enable auto-upload
* TOOLS -> DEPLOYMENT -> AUTOMATIC UPLOAD

There is no need to have git on your local server thats being used to show the website to the world.  If we want to change versions, then we do it locally (on our pc running phpstorm)  then sync the local version with the server.

The pattern is:
* bitbucket is our git repo for all our team
* local git is my local repo
* local server (ubuntu server) is our website display system.

Next setup a bitbucket repo and push local to bitbucket (if you have others also helping develop your site.  If its just you then you dont need bitbucket at all.)

0
Comment actions Permalink

Thanks a lot.

I try to check this out ;-)

Mi

0

Please sign in to leave a comment.