Yes. Use WP_HOME and WP_SITEURL in your wp-config.php, so the URLs in the database won’t mess (a lot) with local site development.
define ('WP_HOME', 'http://local/site/url');
define ('WP_SITEURL', 'http://local/site/url');
Also, some other good practices:
-
Put in your
.gitignorethings like:wp-config.php wp-content/uploads wp-content/cache wp-content ... # Everything that is created by users .htaccess -
Make a copy of the
wp-config.phpfile and use it as a template, name it something likewp-config.php.<your branch name>, add it to the version tree and fill it with the basic development configuration, so developers can just keep theirwp-config.phpuntouched by Git, but can also apply new configuration sets that may be required by other functionality. -
You can also create a
wp-config.php.<branch>for each environment the site runs (development, homologation, production). -
Create a remote
uploadsrepository in the development server, and mount it as a local directory, so an upload to the site that creates a new entry inwp_postswill also sync the file with other developers. Leave the mount information in aREADMEor even in thewp-config.php.<branch>file. You can use a Samba share or even a SSHFS command line like:sshfs user@server:/path/project-uploads wp-content/uploads