Project settings outside of project folder in PhpStorm -
i've been using phpstorm while , although i'm still learning features, stick it. work on 4 machines (a mac, pc, macbook , office pc) , keep project in dropbox location works except server settings debugging set main machine (the mac) because config , locations different - between osx , windows. (on other machines, test google app engine)
my question is: can have project settings stored in separate folder project files. have not yet found way , online not great. if could, keep project settings on each machine allow me run project full server support on each machine.
sadly there no easy means change project configuration directory (project/.idea
) location within phpstorm.
i suggest instead of changing .idea
location, use git repository dropbox acting server, opposed raw dropbox files.
alternatively see: phpstorm - how can avoid creating .idea folder?
along ticket https://youtrack.jetbrains.com/issue/wi-343
you can use .gitignore
omit .idea
folder (or others) commits between different environments.
this way can maintain history between environments , ability revert if issue occurs. share development between other programmers on github. 1 key benefit being able make branches of project bug fixes, major version updates, , more. no more needing copy entire project somewhere else backup, since git manages you!
if you're not familiar git, intuitive use phpstorm , there tons of topics, guides , answered question online when using console features phpstorm doesn't provide gui for. see git documentation phpstorm
first off you'll need install git. don't need fancy gui since phpstorm handle majority of , can installed on os. suggest moving project outside of dropbox directory , local directory, way files won't overlap repo , dropbox.
next need create bare git repository in dropbox synchronized directory on computer. means working copy not checked out, protecting files outside changes. purposes of explanation use skydrive in place of dropbox on windows system.
in console:
$ mkdir d:\skydrive\repos $ cd d:\skydrive\repos $ git init --bare myproject.git
next need initialize git phpstorm project.
this create .git directory inside project in order store computer's history.
now create .gitignore
file in root directory of project.
edit .gitignore
file , add following line.
add paths of other files not want share between different environments, such application cache, session directory, binary files, composer.phar libraries, , on.
next add files being versioned git
you'll notice file names changed green text in phpstorm, indicating new files. files blue text indicate have been modified. red text indicates have not been added versioned git (aka unstaged). grey text file names mean ignored, , normal theme colored text mean have been committed.
one key point git here not track empty directories. such ignoring directory of files, did ignoring .idea
. , need empty directory created in other environments, such /var/cache
, create .gitignore
file in directory , add lines.
* !.gitignore
this ignore files within directory, except .gitignore
file , directory itself.
now need commit
current changes git , add short message of did easy reference later when looking through history.
almost done, need push
changes ~/skydrive/repos/myproject.git
repository known remote origin/master
(by default).
now files , branches managed git , available other computers anytime push
changes remote origin
repository.
last step checkout
project in other computer. open phpstorm, , click check out version control, select git, fill in repository location , store files on local environment (outside of dropbox) , click clone.
when prompted click ok open project , you're done, make changes, commit
them, push
them remote origin
, pull
changes system.
configure project's settings how (or export them installation).
don't forget need
commit
,push
changes make them availablepull
other systems.
a special consideration - sure dropbox has finished syncing before pulling changes system, otherwise may cause corruption of repo.
if occurs can delete remote repo in dropbox directory, recreate new repo using git init --bare repo
in same location described previously, , push latest changes it.
Comments
Post a Comment