简体   繁体   English

将本地合并到开发环境中的冲突

[英]Conflict merging local into develop environment

So because I little mistake i made im having conflicts merging my local files into my develop environment.因此,因为我犯了一个小错误,所以我在将本地文件合并到我的开发环境中时遇到了冲突。

I was working on maintenance on a Wordpress website.我正在 Wordpress 网站上进行维护。 I do this by first testing the updates out on a local environment than push it to the develop environment but i accidently updated few plugins in the dev environment without noticing.我通过首先在本地环境中测试更新而不是将其推送到开发环境来做到这一点,但我不小心在开发环境中更新了几个插件而没有注意到。 when i noticed i switched to the local one and did the updates there now when i want to merge the local files into the dev environment i get this error in my terminal.当我注意到我切换到本地文件并在那里进行更新时,当我想将本地文件合并到开发环境中时,我在终端中收到此错误。

> * 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

You have untracked files that your incoming local branch are trying to write.您有未跟踪的文件,您的传入本地分支正在尝试写入这些文件。 Because when you try to overwrite files, the old one will be gone for good after the overwrite, and git is very good at detecting those conflict and made an effort to warn you to prevent any data loss.因为当您尝试覆盖文件时,旧文件将在覆盖后永久消失,而 git 非常擅长检测这些冲突并努力警告您以防止任何数据丢失。

If you really mean it by "accidentally", it should be pretty much okay to overwrite them with your local branch.如果你真的是“偶然”的意思,那么用你的本地分支覆盖它们应该是可以的。 On dev environment, you can first dicard any changes you made在开发环境中,您可以首先放弃您所做的任何更改

git ls-files --others --exclude-standard | xargs rm -rf

This will remove all of those untracked files.这将删除所有未跟踪的文件。 You can then merge your local branch again.然后您可以再次合并您的本地分支。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM