Drupal Local and Dev Database
in your settings.php, uncomment 

# if (file_exists(__DIR__ . '/settings.local.php')) {
#   include __DIR__ . '/settings.local.php';
# }


so it looks like this:

if (file_exists(__DIR__ . '/settings.local.php')) {
  include __DIR__ . '/settings.local.php';
}


then in the same directory edit the settings.local.php to have your local settings.

Then add settings.local.php to your .gitignore file

That way, you can keep local settings that differ from the settings on dev.

So your dev server would have it's own unique settings.local.php file that differs from your local settings.local.php file.

If you need to check your database settings, you can add this at the bottom of settings.php

dump($databases); die();


You should see your correct settings (you can do this on both your local and your dev site to verify, then remove the dump command once you have verified.