git clone git://develop.git.wordpress.org/ develop

After cloning the core development repository with Git, considering the files and folders are under version control, how can the config files be renamed to wp-config.php and wp-tests-config.php?


I'm aware I can do git mv wp-config-sample.php wp-config.php but now my working copy is different from the upstream repository.

Ref: https://make.wordpress.org/core/2014/01/15/git-mirrors-for-wordpress/

  • You can make another file 'local-wp-config.php' that is conditionally loaded from 'wp-config.php' if exists. You can then add that file to .gitignore. Your local config will be localized to your setup and never uploaded and the process can work w/all team members. You'll have to change 'wp-config.php' to support that type of setup but it works well.
    – jgraup
    Jan 7, 2016 at 15:05

1 Answer 1


Do not rename or modify the sample files unless such modifications are intended for contribution - they are there for reference. The files wp-config.php and wp-tests-config.php are explicitly ignored by .gitignore. Simply create them as new files yourself (or, if you'd like to use the sample files verbatim create symlinks to the sample files) to avoid unnecessary disparity with upstream.

  • Thanks @bosco, that's nicely clarified what should be done. Jan 6, 2016 at 22:46

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.