I want to set up a git project on my local machine.

I have successfully set up the database.

I have run git clone command and clone the project from git but some repository is blank.

so how can I set up a project in the localhost?

If anyone has a solution then provide

Any help would be appreciated.

Thanks in advance..!

2 Answers 2


First of all, you need to check the vendor folder. If it is empty then you need to run the below commands to install core modules of Magento and deploy the project.

composer update
php bin/magento s:up
php bin/magento s:d:c
php bin/magento s:s:d
php bin/magento c:f

Check the composer.json file first before running the composer update command.


Please check the app/etc folder it should contain config.php and env.php. In env.php, the database configuration (your local setup) is set.

I hope it helps!!!

  • 1
    Please check the app/etc folder it should contain config.php and env.php with the local database setup details.
    – Sumit
    Nov 26, 2019 at 5:33
  • 1
    You need to add the config.php here before running these commands. Just copy and paste it from your production branch.
    – Sumit
    Nov 26, 2019 at 5:35
  • 1
    You can copy it from other Magento installation or add it from your production branch.
    – Sumit
    Nov 26, 2019 at 5:39
  • 1
    Check this magento.stackexchange.com/questions/251920/…
    – Sumit
    Nov 26, 2019 at 5:54
  • 1
    thank you for providing help it work for me Nov 26, 2019 at 6:12

Follow below steps to setup project after clone git repository.

  • Export working Projects database and then Import Database
  • Take Clone / Extract the Source code
  • Run the 'composer update' command. (If composer is not installed then run first 'composer install' command and then 'composer update')
  • Run php bin/magento setup:config:set --db-user="dbusername" --db-password="dbpassword" --db-name="dbname" (It creates env.php in following path app/etc/env.php)
  • Run php bin/magento module:enable --all (It creates config.php in following path app/etc/config.php)
  • Run php bin/magento setup:upgrade
  • Run php bin/magento setup:di:compile
  • Run php bin/magento setup:static-content:deploy -f
  • Change base url in database. (Table Name : core_config_data. Change path 'web/unsecure/base_url' & 'web/secure/base_url')

  • Ex:

  • Run php bin/magento cache:clean

  • Now open url in browser

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.