git rebase -i --root:'致命:模棱两可的参数'':未知版本或不在工作树中的路径。'

时间:2018-11-04 07:50:59

标签: git git-rebase

我目前在分支机构master上,并且在历史记录中有提交内容:

% /usr/bin/git --version
git version 2.19.1
% git symbolic-ref --short HEAD
master
% git log --oneline | wc -l
10

当我尝试运行git rebase --interactive --root时,我收到一条奇怪的消息:

% GIT_EDITOR=false /usr/bin/git rebase --interactive --root
fatal: ambiguous argument '': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
Could not execute editor
%

我不知道空参数''在上面指的是什么参数。

通过调试,我看到:

% GIT_EDITOR=false GIT_TRACE=2 GIT_TRACE_SETUP=2 GIT_TRACE_SHALLOW=2 git rebase -i --root
14:49:34.962263 git.c:659               trace: exec: git-rebase -i --root
14:49:34.962348 run-command.c:637       trace: run_command: git-rebase -i --root
14:49:34.995806 git.c:415               trace: built-in: git rev-parse --parseopt --stuck-long -- -i --root
14:49:35.009846 git.c:415               trace: built-in: git rev-parse --git-dir
14:49:35.018685 git.c:415               trace: built-in: git rev-parse --git-path objects
14:49:35.026569 git.c:415               trace: built-in: git rev-parse --is-bare-repository
14:49:35.033518 git.c:415               trace: built-in: git rev-parse --show-toplevel
14:49:35.045959 trace.c:318             setup: git_dir: .git
14:49:35.046032 trace.c:319             setup: git_common_dir: .git
14:49:35.046048 trace.c:320             setup: worktree: /home/ravi/code/aur/nixnote2-bin
14:49:35.046069 trace.c:321             setup: cwd: /home/ravi/code/aur/nixnote2-bin
14:49:35.046093 trace.c:322             setup: prefix: (null)
14:49:35.046115 git.c:415               trace: built-in: git config --bool rebase.stat
14:49:35.052641 trace.c:318             setup: git_dir: .git
14:49:35.052741 trace.c:319             setup: git_common_dir: .git
14:49:35.052755 trace.c:320             setup: worktree: /home/ravi/code/aur/nixnote2-bin
14:49:35.052772 trace.c:321             setup: cwd: /home/ravi/code/aur/nixnote2-bin
14:49:35.052791 trace.c:322             setup: prefix: (null)
14:49:35.052804 git.c:415               trace: built-in: git config --bool rebase.autostash
14:49:35.062737 trace.c:318             setup: git_dir: .git
14:49:35.062827 trace.c:319             setup: git_common_dir: .git
14:49:35.062849 trace.c:320             setup: worktree: /home/ravi/code/aur/nixnote2-bin
14:49:35.062874 trace.c:321             setup: cwd: /home/ravi/code/aur/nixnote2-bin
14:49:35.062886 trace.c:322             setup: prefix: (null)
14:49:35.062897 git.c:415               trace: built-in: git config --bool rebase.autosquash
14:49:35.068433 trace.c:318             setup: git_dir: .git
14:49:35.068508 trace.c:319             setup: git_common_dir: .git
14:49:35.068519 trace.c:320             setup: worktree: /home/ravi/code/aur/nixnote2-bin
14:49:35.068537 trace.c:321             setup: cwd: /home/ravi/code/aur/nixnote2-bin
14:49:35.068571 trace.c:322             setup: prefix: (null)
14:49:35.068591 git.c:415               trace: built-in: git config --bool commit.gpgsign
14:49:35.083354 git.c:415               trace: built-in: git hash-object -t tree /dev/null
14:49:35.093598 trace.c:318             setup: git_dir: .git
14:49:35.093724 trace.c:319             setup: git_common_dir: .git
14:49:35.093743 trace.c:320             setup: worktree: /home/ravi/code/aur/nixnote2-bin
14:49:35.093754 trace.c:321             setup: cwd: /home/ravi/code/aur/nixnote2-bin
14:49:35.093767 trace.c:322             setup: prefix: (null)
14:49:35.093790 git.c:415               trace: built-in: git commit-tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
14:49:35.102720 git.c:415               trace: built-in: git rev-parse --verify 22b8468e9de9755e67055627c8ef9252d8718e7c^0
14:49:35.114634 trace.c:318             setup: git_dir: .git
14:49:35.114701 trace.c:319             setup: git_common_dir: .git
14:49:35.114720 trace.c:320             setup: worktree: /home/ravi/code/aur/nixnote2-bin
14:49:35.114757 trace.c:321             setup: cwd: /home/ravi/code/aur/nixnote2-bin
14:49:35.114771 trace.c:322             setup: prefix: (null)
14:49:35.114786 git.c:415               trace: built-in: git symbolic-ref -q HEAD
14:49:35.132196 git.c:415               trace: built-in: git rev-parse --verify HEAD
14:49:35.175068 git.c:415               trace: built-in: git rev-parse --verify HEAD
14:49:35.181677 trace.c:318             setup: git_dir: .git
14:49:35.181738 trace.c:319             setup: git_common_dir: .git
14:49:35.181752 trace.c:320             setup: worktree: /home/ravi/code/aur/nixnote2-bin
14:49:35.181769 trace.c:321             setup: cwd: /home/ravi/code/aur/nixnote2-bin
14:49:35.181782 trace.c:322             setup: prefix: (null)
14:49:35.181797 git.c:415               trace: built-in: git update-index -q --ignore-submodules --refresh
14:49:35.183609 chdir-notify.c:67       setup: chdir from '/home/ravi/code/aur/nixnote2-bin' to '/home/ravi/code/aur/nixnote2-bin'
14:49:35.189299 trace.c:318             setup: git_dir: .git
14:49:35.189423 trace.c:319             setup: git_common_dir: .git
14:49:35.189475 trace.c:320             setup: worktree: /home/ravi/code/aur/nixnote2-bin
14:49:35.189501 trace.c:321             setup: cwd: /home/ravi/code/aur/nixnote2-bin
14:49:35.189535 trace.c:322             setup: prefix: (null)
14:49:35.189579 chdir-notify.c:67       setup: chdir from '/home/ravi/code/aur/nixnote2-bin' to '/home/ravi/code/aur/nixnote2-bin'
14:49:35.189610 git.c:415               trace: built-in: git diff-files --quiet --ignore-submodules
14:49:35.199575 trace.c:318             setup: git_dir: .git
14:49:35.199650 trace.c:319             setup: git_common_dir: .git
14:49:35.199661 trace.c:320             setup: worktree: /home/ravi/code/aur/nixnote2-bin
14:49:35.199668 trace.c:321             setup: cwd: /home/ravi/code/aur/nixnote2-bin
14:49:35.199680 trace.c:322             setup: prefix: (null)
14:49:35.199718 git.c:415               trace: built-in: git diff-index --cached --quiet --ignore-submodules HEAD --
14:49:35.208214 trace.c:318             setup: git_dir: .git
14:49:35.208280 trace.c:319             setup: git_common_dir: .git
14:49:35.208295 trace.c:320             setup: worktree: /home/ravi/code/aur/nixnote2-bin
14:49:35.208327 trace.c:321             setup: cwd: /home/ravi/code/aur/nixnote2-bin
14:49:35.208341 trace.c:322             setup: prefix: (null)
14:49:35.208355 git.c:415               trace: built-in: git merge-base 22b8468e9de9755e67055627c8ef9252d8718e7c b48b74389cbaa1f973ca8be66823c4c732828a0b
14:49:35.215390 git.c:415               trace: built-in: git rev-parse --git-path hooks/pre-rebase
14:49:35.223436 git.c:415               trace: built-in: git diff --stat --summary  22b8468e9de9755e67055627c8ef9252d8718e7c
fatal: ambiguous argument '': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

0 个答案:

没有答案