前几天,由于git遇到的问题并且没有任何线索如何解决问题,我必须对我们的一台生产服务器进行完整的图像还原。标准工作流已经工作了将近2年没有问题:
- 进行本地更改
- 提交
- 完成功能(gitflow)
- 推到远程原点
-
登录到服务器,转到http root并发出以下命令:
git Pull Master版本_1.x.x
但是,这次而不是像往常一样工作,我被呈现了这个错误。
fatal: failed to open 'app/lang/en/homepage.php': File exists
和其他几个文件一样,该文件在开发人员中进行了更新。我立即获得了服务器监视通知,该通知该网站不再响应。所以我加载了它,我得到了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")
如何更改文件的生产和最新更新一部分的文件是未跟踪文件的?
所以我尝试将更改固定在下一个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拉命令之前检查一下,然后再次弄乱所有内容。以下结果是:
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文件并进行硬重置,然后进行拉动解决问题。课程:Dropbox在与GIT相同的沙箱中玩时可能很危险。