Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 错误:您对以下文件的本地更改将被签出覆盖:wp-config.php_Wordpress_Git - Fatal编程技术网

Wordpress 错误:您对以下文件的本地更改将被签出覆盖:wp-config.php

Wordpress 错误:您对以下文件的本地更改将被签出覆盖:wp-config.php,wordpress,git,Wordpress,Git,我在执行git status命令时收到“无需提交,工作目录清理””消息 但当执行git签出分支名称时会产生错误: error: Your local changes to the following files would be overwritten by checkout: wp-config.php 请检查以下git命令的输出: shahalom@microsolutionsbd~/www/wp projects/atoz查看$git更新索引--假设未更改--wp-config.php

我在执行git status命令时收到“
无需提交,工作目录清理”
”消息

但当执行git签出分支名称时会产生错误:

error: Your local changes to the following files would be overwritten by checkout: wp-config.php
请检查以下git命令的输出:


shahalom@microsolutionsbd~/www/wp projects/atoz查看$git更新索引--假设未更改--wp-config.php
shahalom@microsolutionsbd~/www/wp projects/atoz审查$git状态
论分行行长
未为提交而暂存的更改:
(使用“git add…”更新将提交的内容)
(使用“git签出--…”放弃工作目录中的更改)
修改:.gitignore
未向提交添加任何更改(使用“git add”和/或“git commit-a”)
shahalom@microsolutionsbd~/www/wp projects/atoz reviews$git diff.gitignore
diff--git a/.gitignore b/.gitignore
索引d9d785e..d180ece 100644
---a/.gitignore
+++b/.git忽略
@@-4,4+4,3@@wp内容/插件/wordpress搜索引擎优化/
wp内容/插件/wp邮件smtp/
wp内容/插件/jetpack/
wp内容/插件/谷歌网站地图生成器/
-wp-config.php
shahalom@microsolutionsbd~/www/wp projects/atoz reviews$git add.gitignore
shahalom@microsolutionsbd~/www/wp projects/atoz评论$git commit-F../commitsg.txt
[master d265e1a]从gitignore中删除wp-config.php文件,因为对于.gitignore,只有未跟踪的文件被忽略。
1个文件已更改,1个删除(-)
shahalom@microsolutionsbd~/www/wp projects/atoz审查$git状态
论分行行长
没有要提交的内容,正在清理目录
shahalom@microsolutionsbd~/www/wp projects/atoz审查$git推送原始主机
'的密码https://user_name@org':
计数对象:3,完成。
增量压缩最多使用4个线程。
压缩对象:100%(2/2),完成。
写入对象:100%(3/3),488字节| 0字节/秒,完成。
共3个(增量2),重复使用1个(增量1)
到https://user_name@bitbucket.org/user_name/atoz-reviews.git
c7bebee..d265e1a主控->主控
shahalom@microsolutionsbd~/www/wp projects/atoz审查$git状态
论分行行长
没有要提交的内容,正在清理目录
shahalom@microsolutionsbd~/www/wp projects/atoz评论$git
错误:签出将覆盖您对以下文件的本地更改:
wp-config.php
请在切换分支之前提交或隐藏更改。
流产
shahalom@microsolutionsbd~/www/wp projects/atoz查看$git stash save“未提交文件的未知更改”
没有要保存的本地更改
shahalom@microsolutionsbd~/www/wp projects/atoz评论$git
错误:签出将覆盖您对以下文件的本地更改:
wp-config.php
请在切换分支之前提交或隐藏更改。
流产


我认为它与
git更新索引相关——假设不变--wp config.php
命令。。。但是解决方案是什么呢?

wp config.php
包含特定于每个安装的配置值和敏感信息(数据库用户和密码)。不能将其添加到版本控制系统中。是的,您是对的。不知何故,我将该文件添加到git中,现在使用git update index命令将其删除。可能这就是我收到错误的原因…
wp config.php
包含特定于每个安装的配置值和敏感信息(数据库用户和密码)。不能将其添加到版本控制系统中。是的,您是对的。不知何故,我将该文件添加到git中,现在使用git update index命令将其删除。也许这就是我得到错误的原因。。。
shahalom@microsolutionsbd ~/www/wp-projects/atoz-reviews $ git update-index --assume-unchanged -- wp-config.php
shahalom@microsolutionsbd ~/www/wp-projects/atoz-reviews $ git status
On branch master
Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

    modified:   .gitignore

no changes added to commit (use "git add" and/or "git commit -a")
shahalom@microsolutionsbd ~/www/wp-projects/atoz-reviews $ git diff .gitignore
diff --git a/.gitignore b/.gitignore
index d9d785e..d180ece 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,4 +4,3 @@ wp-content/plugins/wordpress-seo/
 wp-content/plugins/wp-mail-smtp/
 wp-content/plugins/jetpack/
 wp-content/plugins/google-sitemap-generator/
-wp-config.php
shahalom@microsolutionsbd ~/www/wp-projects/atoz-reviews $ git add .gitignore

shahalom@microsolutionsbd ~/www/wp-projects/atoz-reviews $ git commit -F ../commitmsg.txt
[master d265e1a] Remove wp-config.php file from gitignore because with .gitignore, only untracked files are ignored.
 1 file changed, 1 deletion(-)
shahalom@microsolutionsbd ~/www/wp-projects/atoz-reviews $ git status
On branch master
nothing to commit, working directory clean
shahalom@microsolutionsbd ~/www/wp-projects/atoz-reviews $ git push origin master
Password for 'https://user_name@bitbucket.org': 
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 488 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 1 (delta 1)
To https://user_name@bitbucket.org/user_name/atoz-reviews.git
   c7bebee..d265e1a  master -> master
shahalom@microsolutionsbd ~/www/wp-projects/atoz-reviews $ git status
On branch master
nothing to commit, working directory clean
shahalom@microsolutionsbd ~/www/wp-projects/atoz-reviews $ git checkout develop
error: Your local changes to the following files would be overwritten by checkout:
    wp-config.php
Please, commit your changes or stash them before you can switch branches.
Aborting
shahalom@microsolutionsbd ~/www/wp-projects/atoz-reviews $ git stash save "Unknown changes with not file to commit"
No local changes to save
shahalom@microsolutionsbd ~/www/wp-projects/atoz-reviews $ git checkout develop
error: Your local changes to the following files would be overwritten by checkout:
    wp-config.php
Please, commit your changes or stash them before you can switch branches.
Aborting