所以,因为我很少犯错误,所以在将本地文件合并到我的开发环境中时,我遇到了冲突。
我在一个Wordpress网站上做维护工作。我首先在本地环境中测试更新,然后将其推送到开发环境中,但我在开发环境中意外地更新了一些插件,而没有注意到这一点。当我注意到我切换到本地文件并在那里进行更新时,当我想要将本地文件合并到dev环境中时,我在我的终端中得到了这个错误。
> * branch develop -> FETCH_HEAD
Updating f08f8fb..c72a8b7
error: The following untracked working tree files would be overwritten by merge:
wp-content/plugins/redirection/api/api.php
wp-content/plugins/redirection/redirection-capabilities.php
wp-content/plugins/w3-total-cache/BrowserCache_Environment_Nginx.php
wp-content/plugins/w3-total-cache/BrowserCache_Page_View_SectionSecurity.php
wp-content/plugins/w3-total-cache/Cdn_Environment_Nginx.php
wp-content/plugins/w3-total-cache/Extension_Amp_Page_View.php
wp-content/plugins/w3-total-cache/Generic_Page_PurgeLog.php
wp-content/plugins/w3-total-cache/Generic_Page_PurgeLog_View.php
wp-content/plugins/w3-total-cache/LazyLoad_Mutator.php
wp-content/plugins/w3-total-cache/LazyLoad_Mutator_Picture.php
wp-content/plugins/w3-total-cache/LazyLoad_Mutator_Unmutable.php
wp-content/plugins/w3-total-cache/ObjectCache_Page_View_PurgeLog.php
wp-content/plugins/w3-total-cache/Util_DebugPurgeLog_Reader.php
wp-content/plugins/wordfence/css/activity-report-widget.1579191227.css
wp-content/plugins/wordfence/css/diff.1579191227.css
wp-content/plugins/wordfence/css/dt_table.1579191227.css
wp-content/plugins/wordfence/css/fullLog.1579191227.css
wp-content/plugins/wordfence/css/iptraf.1579191227.css
wp-content/plugins/wordfence/css/jquery-ui-timepicker-addon.1579191227.css
wp-content/plugins/wordfence/css/jquery-ui.min.1579191227.css
wp-content/plugins/wordfence/css/jquery-ui.structure.min.1579191227.css
wp-content/plugins/wordfence/css/jquery-ui.theme.min.1579191227.css
wp-content/plugins/wordfence/css/main.1579191227.css
wp-content/plugins/wordfence/css/phpinfo.1579191227.css
wp-content/plugins/wordfence/css/wf-adminbar.1579191227.css
wp-content/plugins/wordfence/css/wf-colorbox.1579191227.css
wp-content/plugins/wordfence/css/wf-font-awesome.1579191227.css
wp-content/plugins/wordfence/css/wf-global.1579191227.css
wp-content/plugins/wordfence/css/wf-ionicons.1579191227.css
wp-content/plugins/wordfence/css/wf-onboarding.1579191227.css
wp-content/plugins/wordfence/css/wf-roboto-font.1579191227.css
wp-content/plugins/wordfence/css/wfselect2.min.1579191227.css
wp-content/plugins/wordfence/css/wordfenceBox.1579191227.css
wp-content/plugins/wordfence/js/Chart.bundle.min.1579191227.js
wp-content/plugins/wordfence/js/admin.1579191227.js
wp-content/plugins/wordfence/js/admin.ajaxWatcher.1579191227.js
wp-content/plugins/wordfence/js/admin.liveTraffic.1579191227.js
wp-content/plugins/wordfence/js/date.1579191227.js
wp-content/plugins/wordfence/js/jquery-ui-timepicker-addon.1579191227.js
wp-content/plugins/wordfence/js/jquery.colorbox-min.1579191227.js
wp-content/plugins/wordfence/js/jquery.colorbox.1579191227.js
wp-content/plugins/wordfence/js/jquery.dataTables.min.1579191227.js
wp-content/plugins/wordfence/js/jquery.qrcode.min.1579191227.js
wp-content/plugins/wordfence/js/jquery.tmpl.min.1579191227.js
wp-content/plugins/wordfence/js/jquery.tools.min.1579191227.js
wp-content/plugins/wordfence/js/knockout-3.3.0.1579191227.js
wp-content/plugins/wordfence/js/wfdashboard.1579191227.js
wp-content/plugins/wordfence/js/wfdropdown.1579191227.js
wp-content/plugins/wordfence/js/wfglobal.1579191227.js
wp-content/plugins/wordfence/js/wfpopover.1579191227.js
wp-content/plugins/wordfence/js/wfselect2.min.1579191227.js
wp-content/plugins/wordfence/modules/login-security/css/admin-global.1579191227.css
wp-content/plugins/wordfence/modules/login-security/css/admin.1579191227.css
wp-content/plugins/wordfence/modules/login-security/css/colorbox.1579191227.css
wp-content/plugins/wordfence/modules/login-security/css/font-awesome.1579191227.css
wp-content/plugins/wordfence/modules/login-security/css/ionicons.1579191227.css
wp-content/plugins/wordfence/modules/login-security/css/jquery-ui-timepicker-addon.1579191227.css
wp-content/plugins/wordfence/modules/login-security/css/jquery-ui.min.1579191227.css
wp-content/plugins/wordfence/modules/login-security/css/jquery-ui.structure.min.1579191227.css
wp-content/plugins/wordfence/modules/login-security/css/jquery-ui.theme.min.1579191227.css
wp-content/plugins/wordfence/modules/login-secu
Aborting发布于 2020-02-06 20:02:27
您的传入本地分支正在尝试写入未跟踪的文件。因为当你尝试覆盖文件时,旧的文件将在覆盖后一去不复返,而git非常擅长检测这些冲突,并努力警告您防止任何数据丢失。
如果你真的指的是“意外”,那么用你的本地分支来覆盖它们应该是很好的。在dev环境中,您可以首先记录您所做的任何更改。
git ls-files --others --exclude-standard | xargs rm -rf这将删除所有这些未跟踪的文件。然后,您可以再次合并本地分支。
https://stackoverflow.com/questions/60093925
复制相似问题