Unable to track files in long PATHs by Git
Git says to use
git add
to add untracked files to my repo.
I have run unsuccessfully
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 .
I still get that the files are untracked when I see it at
git status
How can you git-add files at long PATHs?
I run
$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
The following is what is unexpected. I would expect that I added the folders to be tracked and their contents too.
$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)
$
Are these directories empty? If so, Git does not track empty directories.
If you really need to add those directories to your repository, try adding an empty ".gitignore" file in each one.
For some background information on this design decision, see this thread from the Git email list.
It could be that the files in those folders are somehow ignored? Check your .gitignore and .git/info/exclude files.
链接地址: http://www.djcxy.com/p/92370.html上一篇: 运行git pull遍历所有子目录
下一篇: 无法通过Git跟踪长PATH中的文件