无法通过Git跟踪长PATH中的文件
Git说要使用
git add
将未跟踪的文件添加到我的回购。
我运行失败
git add shells/zsh/keyboard_configs/
git add shells/zsh/references/
git add shells/zsh/keyboard_configs/*
git add shells/zsh/references/*
git add shells/zsh/keyboard_configs/*<TAB>
git add shells/zsh/references/*<TAB>
git add .
当我看到它时,我仍然知道这些文件没有被跟踪
git status
你怎么能在长路径上添加文件?
我跑
$git status ~/bin
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# shells/zsh/keyboard_configs/
# shells/zsh/references/
nothing added to commit but untracked files present (use "git add" to track)
$git add shells/zsh/keyboard_configs ~/bin
$git add shells/zsh/references ~/bin
以下是意想不到的。 我希望我添加了要跟踪的文件夹及其内容。
$git status ~/bin
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# shells/zsh/keyboard_configs/
# shells/zsh/references/
nothing added to commit but untracked files present (use "git add" to track)
$
这些目录是空的吗? 如果是这样,Git不会跟踪空目录。
如果您确实需要将这些目录添加到存储库,请尝试在每个文件中添加一个空的“.gitignore”文件。
有关此设计决策的一些背景信息,请参阅Git电子邮件列表中的该主题。
可能是这些文件夹中的文件被忽略了? 检查你的.gitignore和.git / info / exclude文件。
链接地址: http://www.djcxy.com/p/92369.html上一篇: Unable to track files in long PATHs by Git
下一篇: Why is the `git subtree` not working even though I have git 1.8.3.2 installed on Ubuntu 12.10?