- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
有一天,由于 git 遇到问题,我不得不对我们的一台生产服务器进行完整的镜像恢复,并且不知道如何解决该问题。标准工作流程已经运行了近 2 年,没有出现任何问题:
登录服务器,转到 http root 并发出以下命令:
git pull master Version_1.x.x
但是,这一次我没有像往常一样工作,而是遇到了这个错误。
fatal: failed to open 'app/lang/en/homepage.php': File exists
该文件与其他几个文件一样在 dev 中进行了更新。我立即收到服务器监控通知,该网站不再响应。所以我加载了它,但出现了 404 错误??
返回控制台 git status
并对所展示的内容感到震惊。
On branch master
Changed but not updated:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: app/views/layouts/landingBody.blade.php
modified: app/views/layouts/trailblazers.blade.php
modified: app/views/mobile/UI/landingBody.blade.php
modified: public/images/spashPage_full_new.jpg
Untracked files:
(use "git add <file>..." to include in what will be committed)
public/images/3rd_Party/
public/images/UI_bg_login_summer2015.jpg
public/images/spashPage_full_1024_summer2015.jpg
public/images/spashPage_full_1200_summer2015.jpg
public/images/spashPage_full_blur_summer2015.jpg
public/images/spashPage_full_summer2015.jpg
no changes added to commit (use "git add" and/or "git commit -a")
文件在生产中已被更改,并且属于最新更新的文件被报告为未跟踪文件,这怎么可能?
因此,我尝试 stash 更改,这些更改可预见地在下一个 git status
上返回以下内容
On branch master
nothing to commit (working directory clean)
我尝试了从硬重置到重置到特定提交的所有方法,但情况逐渐变得更糟,直到我得到的程度。
我遇到了诸如
之类的错误git reset --hard ORIG_HEAD
error: git checkout-index: unable to create file app/3rdParty/Mobile_Detect.php (File exists)
error: git checkout-index: unable to create file app/config/app.php (File exists)
不知道还能做什么,我从快照进行了完整恢复。现在我回到了上次备份,该备份距今不到 16 小时,并且此后没有进行任何其他更改,我执行了 git status
在同一台生产机器上。只是为了在实际发出另一个 git pull 命令并再次搞乱一切之前进行检查。结果如下:
On branch master
Changed but not updated:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: public/.htaccess
Untracked files:
(use "git add <file>..." to include in what will be committed)
app/config/auth.php
app/config/cache.php
app/config/compile.php
app/config/database.php
app/config/remote.php
app/config/session.php
app/views/emails/
app/views/hello.php
bootstrap/compiled.php
readme.md
no changes added to commit (use "git add" and/or "git commit -a")
这怎么可能呢?除了git pull <local branch> <origin branch>
之外,生产中什么也没做。 ,但还有未跟踪的文件和已修改的文件。
我有需要“推送”到生产中的更新,但我不能让网站再次关闭。不是 git 专家使得这变得特别困难。
我确实检查了生产环境中的 git 日志,并将其与原始版本进行了比较,开发和提交都匹配。这一切都非常令人困惑。
任何帮助将不胜感激。
最佳答案
问题出在 Dropbox 内。其中一个子目录的 .gitignore 文件已被删除并替换为备用版本,并且在以前的版本中无意中推送。下次更新的时候一切都完全不正常了。用正确的版本替换 .gitignore 文件并进行硬重置,然后 pull 解决了问题。教训:当 Dropbox 与 git 在同一个沙箱中运行时,可能会很危险。
关于linux - Git 困惑。 "fatal: failed to open ' app/lang/en/homepage.php': File exists",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30158534/
我有一个程序可以打开一个窗口并快速改变背景颜色并随机弹出矩形和椭圆形。我的代码有效,但我不知道为什么,因为我没有在我的代码中调用 repaint() 函数。当我使用我个人的 update() 函数包含
var allRapidSpells = $$('input[value^=RSW]'); 谁能告诉我这是做什么的? 最佳答案 我敢猜测您正在使用 MooTools ,一个 JavaScript 框架
我有一个抽象父类,它有多个子类。我希望 child 能够拥有一个对于该 child 的每个实例都相同的变量。我不想将构造函数传递给 child 来告诉它它的名字,因为当它可以被硬编码时,这看起来很愚蠢
我刚刚在 Git 存储库上做了一些糟糕的事情,我不知道如何解决这个问题。我什至不知道我是怎么把它弄成这样的……! 在存储库(托管在 git hub 上)上,有 3 个我感兴趣的分支:master、br
我是 GIT 的新手,在理解提交日志图时遇到问题。 我感觉每条平行线都是一个分支。虽然我的源代码只有 2 个分支。我在下面提供的提交日志图中看到 3-4 条平行线(Microsoft Team Ser
我是 WPF 的新手,ScrollViewer 让我很沮丧。要么我只是没有“得到”它,要么它是一种有限的控制。 这是我的挫折: 水平滚动错误 水平滚动条仅在列表底部可见(我必须滚动到底部才能看到) 坏
那么 $('table.selectable td.capable input:text') 比 $('table.selectable td input:text') 更好吗?换句话说,指定一个类会
我刚刚完成了计算机图形学类(class),我们必须对光线追踪器进行编程。尽管所有结果都是正确的,但我对 OpenMP 的使用感到困惑(顺便说一句,这不是类(class)的一部分)。我有这个循环(C++
与 PatternSynonyms ( explicitly bidirectional form ),pattern-to-expr 方程实际上形成了一个函数,但拼写为大写(假设您最终得到正确类型的
我是 javascript/coffeescript 新手。 有人可以解释一下为什么这个 CoffeeScript/JavaScript 会毫无延迟地快速通过吗?我对第一种情况的想法是,它是对 upd
如果我调用document.getElementsByClassName('cl'),我会得到一个 HTMLCollection。它似乎包含 Element 对象而不是 HTMLElement 对象,
这是我本月的 azure payasyougo 使用费用。 我很难理解为什么我要为标准中型应用服务付费,我认为它会包含在计算时间中?我只运行一个云服务,这对于一个没有做太多事情的云服务来说似乎有点陡峭
除了the issue I am already having之外,我还在I saw a video on it之后安装了HBase(尚未安装)之前,还安装了Zookeeper。在安装它时,我遇到了许
我正在将 XSLT 与 regexp:match exslt 函数一起使用。上述函数采用 JavaScript Regex 模式。因此,我尝试匹配一组数字 1 到 3 OR 5 到 7 OR 9 到
我想知道为什么这段代码会给出消息:SyntaxError:意外的标记其他。 var compare = function(choice1,choice2){ if(choice1===choice2)
我尝试使用复选框和 JQuery 过滤日历上的事件, $(document).ready(function () { $('.scrollable-menu :checkbox').click(f
假设我们有一个用户想要一个名为:“test/lasdhjal.txt”,无论如何。现在,如果我将其放入新的文件(输入)中;对象里面,它会认为 test/是一个文件夹,而它是名称的一部分。我能做什么呢?
问题是 stash 的更改不会留在我 stash 它们的分支中。其他分支存储将被覆盖示例: 我愿意: git checkout iss4 // made some changes gi
我是一个 java 新手,并且在 StackOverflow 错误/在类之间访问文件的能力方面遇到了一个非常令人困惑的问题。我知道根本原因可能是我进行了一些递归调用,但修复它的语法却让我无法理解。我认
public X createData(int n) { int[] values = new int[n]; Random rand = new Random(); for
我是一名优秀的程序员,十分优秀!