相关疑难解决方法(0)

从git中删除一个带有奇怪名称的文件

我有一个文件,设法让自己命名:

# file's name (both lines)
companies.yml
companies.yml

# entry in my git working tree
"test/fixtures/companies.yml\342\200\250companies.yml"
Run Code Online (Sandbox Code Playgroud)

由于令人讨厌的原因,此特定项目的工作树中充满了仍需要组织的其他文件.我想从上面输入上面的条目,但是当我尝试git add "test/fixtures..."git rm "test/fixtures..."它失败时:
fatal: pathspec 'test/fixtures/companies.yml\342\200\250companies.yml' did not match any files

我怎么处理这个?


Git状态

On branch master
# Your branch is ahead of 'production/master' by 4 commits.
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)

modified:   [other …
Run Code Online (Sandbox Code Playgroud)

git

9
推荐指数
2
解决办法
2835
查看次数

Git:如何在命令行上指定包含八进制表示法的文件名

对于文件名中的非ASCII字符,Git将以八进制表示法输出它们.例如:

> git ls-files
"\337.txt"
Run Code Online (Sandbox Code Playgroud)

如果这样的字节序列不表示合法编码(对于命令行的当前编码),我无法在命令行上输入相应的字符串.我怎样才能在这些文件上调用Git命令?显然,使用显示的字符串git ls-files不起作用:

> git rm "\337.txt"
fatal: pathspec '337.txt' did not match any files
Run Code Online (Sandbox Code Playgroud)

在Windows上测试,使用msysgit 1.7.10(git版本1.7.10.msysgit.1)

git encoding notation octal

5
推荐指数
1
解决办法
1456
查看次数

标签 统计

git ×2

encoding ×1

notation ×1

octal ×1