1

我对git的理解不包括这种情况。我无法通过运行 'git status'git reset --hard HEADgit clean -fd. 似乎 git 正在跟踪目录中的两个文件,而不是目录本身。这是摘录

~/work/ghc/libraries/haskeline ((no branch)) $ git status
# Not currently on any branch.
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   "tests/dummy-I\314\202\302\274I\314\202\302\261I\314\210\302\203/"
nothing added to commit but untracked files present (use "git add" to track)

~/work/ghc/libraries/haskeline ((no branch)) $ git clean -fd
Removing "tests/dummy-I\314\202\302\274I\314\202\302\261I\314\210\302\203/"

~/work/ghc/libraries/haskeline ((no branch)) $ git status
# Not currently on any branch.
# Changes not staged for commit:
#   (use "git add/rm <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#   deleted:    "tests/dummy-\303\216\302\274\303\216\302\261\303\217\302\203/bar"
#   deleted:    "tests/dummy-\303\216\302\274\303\216\302\261\303\217\302\203/\303\217\302\202\303\216\302\265\303\217\302\201\303\217\302\204"
#
no changes added to commit (use "git add" and/or "git commit -a")

~/work/ghc/libraries/haskeline ((no branch)) $ git reset --hard
HEAD is now at 40bcd6a Fix build on Win64

~/work/ghc/libraries/haskeline ((no branch)) $ git status
# Not currently on any branch.
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   "tests/dummy-I\314\202\302\274I\314\202\302\261I\314\210\302\203/"
nothing added to commit but untracked files present (use "git add" to track)

~/work/ghc/libraries/haskeline ((no branch)) $ git log tests/dummy-μαÏ/
~/work/ghc/libraries/haskeline ((no branch)) $ git log tests/dummy-\303\216\302\274\303\216\302\261\303\217\302\203/bar
fatal: ambiguous argument 'testests/dummy-303216302274303216302261303217302203/bar': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

~/work/ghc/libraries/haskeline ((no branch)) $ git log "testests/dummy-\303\216\302\274\303\216\302\261\303\217\302\203/bar"
fatal: ambiguous argument 'testests/dummy-\303\216\302\274\303\216\302\261\303\217\302\203/bar': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

~/work/ghc/libraries/haskeline ((no branch)) $ cd tests/dummy-μαÏ/
~/work/ghc/libraries/haskeline/tests/dummy-Î¼Î±Ï ((no branch)) $ ls
Ï?εÏ?Ï?         bar

~/work/ghc/libraries/haskeline/tests/dummy-Î¼Î±Ï ((no branch)) $ git status
# Not currently on any branch.
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   "../dummy-I\314\202\302\274I\314\202\302\261I\314\210\302\203/"
nothing added to commit but untracked files present (use "git add" to track)

~/work/ghc/libraries/haskeline/tests/dummy-Î¼Î±Ï ((no branch)) $ git log bar 
commit e9c39a16fdecf529e7a86beb3971eb351e915de5
Author: Judah Jacobson <judah.jacobson@gmail.com>
Date:   Sun Jul 22 22:14:08 2012 +0000

    Add test folder for unit-testing file completion.

~/work/ghc/libraries/haskeline/tests/dummy-Î¼Î±Ï ((no branch)) $ git log .
commit e9c39a16fdecf529e7a86beb3971eb351e915de5
Author: Judah Jacobson <judah.jacobson@gmail.com>
Date:   Sun Jul 22 22:14:08 2012 +0000

    Add test folder for unit-testing file completion.

~/work/ghc/libraries/haskeline/tests/dummy-Î¼Î±Ï ((no branch)) $ cd ..
~/work/ghc/libraries/haskeline/tests ((no branch)) $ git log dummy-μαÏ/
~/work/ghc/libraries/haskeline/tests ((no branch)) $ 

这是我应该报告的 git 错误吗(可能与所涉及的非 ascii 文件名有关)?如果没有,有人可以解释为什么这是有道理的吗?

最后一点:libraries/haskline 目录是 ghc 目录中的一个 git 子模块。我不知道这应该有所作为。另外,我的提示包含当前的 git 分支。显式运行命令给出

~/work/ghc/libraries/haskeline/tests ((no branch)) $ git branch
* (no branch)
  master
4

0 回答 0