- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
根据git documentation ,我可以像这样从我的 repo 历史中删除一个文件:
git filter-branch --tree-filter 'rm -rf filename' HEAD
我试过了,得到了这个错误:
You need to run this command from the toplevel of the working tree.
所以,我试过了,得到了同样的错误:
git filter-branch --index-filter 'rm -f /dist/bikeMap.html' HEAD
查了多个stackoverflow的问题,我也试过了
git filter-branch --index-filter 'rm -f /dist/bikeMap.html' master..HEAD
git filter-branch --tree-filter 'rm -f /dist/bikeMap.html' --all
git filter-branch --tree-filter 'rm -f /dist/bikeMap.html' -- --all
git filter-branch --tree-filter 'rm -f /dist/bikeMap.html' master
等等。都给出相同的错误。
git status
说
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working tree clean
我的 git 版本是 2.11.0
。
编辑:我现在也尝试过:
git filter-branch --index-filter "git rm --cached --ignore-unmatch dist/bikeMap.html" HEAD
git filter-branch --index-filter "git rm --cached --ignore-unmatch dist/bikeMap.html" -- HEAD
git filter-branch -f --index-filter 'git rm --cached --quiet --force "dist/bikeMap.html"' --prune-empty -- HEAD
git filter-branch -f --index-filter 'git rm --cached --quiet --force dist/bikeMap.html' --prune-empty -- HEAD
git filter-branch -f --index-filter 'git rm --cached --quiet --force dist/bikeMap.html' --prune-empty -- master
git filter-branch -f --index-filter 'git rm --cached --quiet --force dist/bikeMap.html' --prune-empty master
git filter-branch -f --index-filter 'git rm --cached --quiet --force /dist/bikeMap.html' --prune-empty master
git filter-branch -f --index-filter 'git rm --cached --quiet --force /dist/bikeMap.html' --prune-empty HEAD
同样的错误。
编辑:进步!
git filter-branch --index-filter 'git rm --cached --quiet --force dist/bikeMap.html' --prune-empty
导致错误
Rewrite 419e8702fd8a5fe9ddad59a0fd7ff008edffdeab (1/47) (0 seconds passed, remaining 0 predicted)
fatal: pathspec 'dist/bikeMap.html' did not match any files
index filter failed: git rm --cached --quiet --force dist/bikeMap.html
如果我 ls dist/bikeMap.html
我得到
dist/bikeMap.html
所以,它存在。
我如何使用 git filter-branch
从我们的 repo 中删除文件?
最佳答案
要使用 --tree-filter
,请将 rm
命令从使用 /dist/bikeMap.html
更改为使用 dist/bikeMap.html
,即删除前导斜杠。
要使用 --index-filter
,请将命令更改为 git rm --cached --ignore-unmatch dist/bikeMap.html
,即使用 git rm
带有额外的选项(并删除前导斜杠)。
(索引过滤器会快得多。如果你只想从所有具有该命名文件的提交中删除一个命名文件,请将索引过滤器与 git rm --cached --ignore-unmatch
.)
关于git - 如何使用 git filter-branch 从我的存储库中删除文件? ("you need to run this command from the toplevel of the working tree"),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52601945/
所以我编写了这个简单的代码来重新创建我希望我的实际应用程序的行为方式(对不起,如果我没有使用 oop 并且真的很新): import tkinter as tk from tkinter import
我无法销毁顶级(Tkinter、python) 在我的程序中 1) 在开始时用户按下按钮并出现顶层 2) 在顶层还有一些小部件和一个按钮 3)当用户按下这个(第二个)按钮时,函数(name_of_to
我制作了一个顶级小部件,但当它弹出时,它总是出现在我的根窗口下方。有没有一种简单的方法可以让它在弹出时到达最顶层? 最佳答案 您可以在顶级小部件上使用 .lift() 方法: import tkint
我有以下代码,当该方法运行时,Toplevel 窗口显示正确的标题和内容,但仍然是很小的默认大小。我是不是在做一些愚蠢且明显错误的事情? def new_game(self): self.to
编辑:让我包含我的代码,以便我可以获得一些特定的帮助。 import Tkinter def goPush(): win2=Tkinter.Toplevel() win2.geomet
我正在开发一个程序,该程序使用 tkinter TopLevel 窗口向用户显示定期更新的日志信息。我的问题是主程序是全屏的,所以每当他们在打开日志窗口后与之交互时,日志窗口是不可见的,因为它现在位于
我正在尝试将一个窗口图标添加到主窗口的子窗口中,该窗口内置于 TKinter 中。为了便携性(又名不丢失文件),我从 base64 编码的 gif 中设置了主窗口图标作为变量。我一直无法为子窗口复制它
我想了解 Tkinter 中的 Toplevel 小部件。我想创建一个带有按钮的窗口,单击该按钮会打开一个包含内容的新窗口。 我有这个,可以很好地打开一个新窗口,但我不知道如何编辑该新窗口的内容。 f
tk.Toplevel.deiconify() 有替代方案吗?我想显示一个设定数量的窗口,然后隐藏它: def show(self, event): self.master.geometry(
Toplevel 有一个方法 distroy,我很难从类内部访问它。 此代码有效: top = Toplevel() Message(top, text="bla bla bla...").pack(
我有 1 个根窗口和一个顶层窗口,我想将内容放在顶层窗口的框架中。但是,框架(而不是其中的标签)出现在根窗口中。 窗口截图。 from tkinter import * root = Tk() Lab
我正在查看 tkinter 的 Toplevel。从我所看到的effbot我可以省略它的父参数。 1-当我只使用 Toplevel 本身(注释掉 root)时,我相信它会创建自己的父窗口,因为会出现两
我有以下代码,我想将小部件初始化为默认值,但他们坚持不这样做。我正在设置 StringVar() 变量,并分配它们,但它仍然不起作用。有什么建议吗? import tkinter as tk from
我创建了一个 topLevel 小部件,想知道是否有一种方法可以相对于根窗口定位新窗口。 最佳答案 获取root窗口位置: x = root.winfo_x() y = root.winfo_y()
我正在尝试制作一个 Toplevel 小部件,它是屏幕上的事件窗口(我想要它,这样如果您按 Enter,它就会退出窗口。我已经将键绑定(bind)到小部件,但我似乎无法让窗口成为我计算机上的主窗口
以下代码按预期工作,不会触发断言: @ndb.transactional @ndb.tasklet def Foo(): assert ndb.in_transaction() 以下代码中断,触发
我遇到一个奇怪的问题,我的组件可以正确呈现(服务器端),但是 chrome devtools 中的 React 选项卡只显示 .我已经确认 window.React可用,所以我不确定是什么问题。 最
我创建了一个列表,其中包含 ocaml 中的很多元素,我想看看里面有什么,但是 ocaml 只显示了其中的一小部分像这样:[e1,e2,e3;...]。如何配置 ocaml 以显示所有内容? 最佳答案
关闭第一个顶级后尝试在 Tkinter 中创建第二个顶级时,出现错误: _tkinter.TclError: bad window path name ".!toplevel 仅当第一个顶级关闭时才会
我正在尝试创建一个 Toplevel窗口出现在我的其他窗口之一旁边,但我无法弄清楚如何在显示窗口之前设置该窗口的位置。这是简单的几行: histogram_window = Toplevel(self
我是一名优秀的程序员,十分优秀!