Good way to manage CakePHP, MAMP, and git?

I’d like to get started with using git using the free bitbucket account.

Right now, I’m using Mac along with MAMP. I have MAMP set my Document Root into my Sites folder, as /Users/kurisukun/Sites. Then for my cakephp, I just plopped the entire cakephp folder into the sites. So my folder structure looks like this:

  • cakephp 3 failed to open vendor/autoload.php after cloning a git repository
  • Git workflow for a small team of developers and designers
  • How does one control how Handlebars generates newline characters?
  • How to change postgresql.conf default values on Openshift
  • Best option for deploying a CakePHP web app to shared hosting
  • Can I have two different versions of cakephp into same Git repo? With different Git branches?
  • /Users/kurisukun/Sites
       app
       cake
       etc..
    

    However, when I began trying out the git installation, I noticed that after creating a repository on bitbucket and cloning it into my Sites folder, it creates a sub-folder, such as:

    /Users/kurisukun/Sites
       myproject1/
          app
          cake
          etc..
    

    The problem with this is that it breaks my cake. I believe it would work if I keep changing my MAMP Document Root to the appropriate webroot folder. As in the above case, I’d go into MAMP and change the Document Root to /Users/kurisukun/Sites/myproject1/app/webroot. But when I want to change to another project to run, then I’d have to change the Document Root to say, /Users/kurisukun/Sites/myproject2/app/webroot.

    In the end, I would like to be able to use a subfolder structure like this as a way to have multiple cake projects. Each project will be a cloned git repository. But, is there a way to not have to change MAMP’s Document Root each time I want to run another cake project?

    Thank you!

  • How do you update the app.json manifest on a running heroku app?
  • Git: Move head one commit ahead
  • Git won't show log unless I am in the project directory
  • replay git commits on repo with different root
  • How to make a Git merge operation ignore identical changes made to both branches?
  • Gitlab: Is it possible to create a merge request from MY fork to Another fork of the same project
  • One Solution collect form web for “Good way to manage CakePHP, MAMP, and git?”

    I have a very similar setup to yours, and your folder structure should work nicely, with each of your projects inside of your /Sites directory. You’ll just need the appropriate Apache configuration to set up each one of your projects on their own domain. I use http://{project}.localhost as the URL for each of my projects. In your httpd.conf (mine is located in /Applications/MAMP/conf/apache/httpd.conf) you’ll want to add a directive for your new project, for example, place this at the bottom of your httpd.conf:

    <VirtualHost *>
    ServerName myproject1.localhost:80
    DocumentRoot "/Users/kurisukun/Sites/myproject1"
    </VirtualHost>
    

    Note that I’m using port 80 for my MAMP, so substitute that number for 8888 or whichever port you’re using if necessary. And then you’ll just need to set your /etc/hosts file to recognize your new domain. You’ll need to edit the file as root, so:

    $ sudo emacs /etc/hosts/
    

    (you can substitute vim/nano/text editor of your choice), and inside the file you’ll want to add the line:

    127.0.0.1       myproject1.localhost
    

    And then try hitting http://myproject.localhost in your browser — or http://myproject.localhost:%5Bport%5D if it’s not 80 — and you should be all set!

    Git Baby is a git and github fan, let's start git clone.