Using SourceTree and BitBucket for a Wordpress project.
Checked in wordpress wp-config.php file which holds the details to the database for the online/staging version of our site.
I want this file to stay in the repository but NOT be checked out with the rest of the files, as it overwrites the local version which has different database credentials.
How can I stop this? Every time I pull, it overwrites my version of the file. I tried "stop tracking" but it wants me to commit this to the main respository, which will obviously affect the file which is checked in.
Users cloning the project should NOT check out the wp-config file with the rest of the files, and it should leave their own in place.
I would recommend renaming the version that is in the repository to wp-config.default.php, ignore "wp-config.php" and commit the .gitignore file, and instruct users who are cloning the repository for the first time to copy wp-config.default.php to wp-config.php and change values as necessary.
I have done, added the following to my own .gitignore file and pushed that file to respository:
*.log
.htaccess
sitemap.xml
sitemap.xml.gz
wp-config.php
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
wp-content/upgrade/
wp-content/uploads/
wp-content/wp-cache-config.php
Still, when I go into Source Tree there in the working copy is my wp-config.php file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I have done, but it is still there waiting to be checked in.
Created .gitignore with following:
*.log
.htaccess
sitemap.xml
sitemap.xml.gz
wp-config.php
wp-content/advanced-cache.php
wp-content/backup-db/
wp-content/backups/
wp-content/blogs.dir/
wp-content/cache/
wp-content/upgrade/
wp-content/uploads/
wp-content/wp-cache-config.php
Checked this in. Still see wp-config as modified file.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I don't think you can ignore files that are already tracked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How can I untrack them? At present I cannot do anything with my entire branch unless I manually untick the wp-config. Is this not a feature that Source Tree can handle? Seems bad to me.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I explained the recommended steps in my answer. Comment on that if something is unclear.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.