How use settings.local.php with Acquia Cloud
The default .gitignore file that ships with your Acquia Cloud git repository is fine as it is. See https://drupal.stackexchange.com/a/193251/23961

I also advised against adding settings.php to your .gitignore file here.

Using settings.local.php is optional. Details about the file are available in the file or the online Drupal documentation as described already here.