我只想查看每次提交时GIT_COMMIT变量的内容:
git filter-branch --tree-filter 'echo $GIT_COMMIT' -- --all我得到这个错误:
WARNING: git-filter-branch has a glut of gotchas generating mangled history
rewrites. Hit Ctrl-C before proceeding to abort, then use an
alternative filtering tool such as 'git filter-repo'
(https://github.com/newren/git-filter-repo/) instead. See the
filter-branch manual page for more details; to squelch this warning,
set FILTER_BRANCH_SQUELCH_WARNING=1.
Proceeding with filter-branch...
fatal: bad revision '$GIT_COMMIT''我该如何解决这个问题呢?
发布于 2021-02-10 16:57:42
如果你在Windows中使用CMD,那么是的,作为Marc Luzzara的commented,使用双引号会有所帮助。
但实际的错误消息将是:
set FILTER_BRANCH_SQUELCH_WARNING=1
git filter-branch --tree-filter 'echo $GIT_COMMIT' @
fatal: ambiguous argument '$GIT_COMMIT'': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
# or, as mentioned in the OP
git filter-branch --tree-filter 'echo $GIT_COMMIT' -- --all
fatal: bad revision '$GIT_COMMIT''同样的命令也适用于git bash会话:
$ git filter-branch --tree-filter 'echo $GIT_COMMIT' -- --all
Rewrite 92a741579ad31e6ccb17fda876e084b181bbdcdb (1/4) (0 seconds passed, remaining 0 predicted) 92a741579ad31e6ccb17fda876e084b181bbdcdb
...https://stackoverflow.com/questions/66132463
复制相似问题