I have created a site using pantheon for the first time, it gives me the option of using git to clone the site down to local so I can make some changes.
Will this work with local and if so has anyone got experience with this?
I was simply going to clone the site into /Local Sites/ dir but wanted to check first.
Local doesn’t automatically map the folders in Local Sites to the sites in Local. In other words, you’ll need to create a site in Local prior to cloning it with Git.
I’m unfamiliar with how Pantheon handles Git, but here are two potential ways you can go about this.
Option A (Manual): Create a brand new site in Local and clone
Create a new site in Local with the desired name and local site domain
Copy the site’s app/public/wp-config.php file somewhere safe like your Desktop
Delete the site’s app/public folder
Clone the git repository (assuming the repository includes all WordPress core files) into app/public
Copy the wp-config.php file that you backed up back into app/public
Go to the site in Local then navigate to Database » Adminer
Select all tables and drop them
Download the appropriate SQL backup from your host
Go back to Adminer and import the SQL file
Right-click on the site in Local
Go to ‘Open Site SSH’
Enter wp search-replace '//olddomain.com' '//newdomain.com' (olddomain.com being your live domain and newdomain.com being your Local site domain)
Test the site
Option B: Import the site from a backup and then clone the repository
Download a recent backup from your host that contains all WordPress core files as well as a database dump. The backup must contain at least the wp-content folder and an SQL file.
Drag and drop the backup onto Local’s main window or Dock icon to kick off an import
Follow the import process and verify that the site is working locally
Copy the site’s app/public/wp-config.php file somewhere safe like your Desktop
Delete the site’s app/public folder
Clone the git repository (assuming the repository includes all WordPress core files) into app/public
Copy the wp-config.php file that you backed up back into app/public