“git add -all”命令不在我的GitRepository / .vim / subdir / sub-subdir下添加文件

时间:2016-05-27 01:37:38

标签: git vim

我只想在我拥有的每台计算机上同步我的.vim文件夹。这就是我为此目的所做的:1。cp -r~ / .vim~ / GitRepository / 2.cd~ / GitRepository 3. git add --all 4. commit and push。但是当我检查我的github时,那些文件应该在/.vim/subdir/sub-subdir下面。那些子子目录变空了。什么可以实现这一点,虽然我没有.gitignore文件和link中的建议对我没有帮助。

当我输入git状态时。这些说明显示:

─➤  git status

On branch master
Your branch is up-to-date with 'origin/master'.

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)
  (commit or discard the untracked or modified content in submodules)

modified:   .vim/bundle/vim-snippets (modified content)
no changes added to commit (use "git add" and/or "git commit -a")

是什么让这种情况发生的?

===============第二次编辑============= 感谢你们。 “git add -all”实际上错过了我的点文件。但是,它并没有克服我的问题。

这是我输入git add .vim /

后的内容
╰─➤  git status
On branch master
Your branch is up-to-date with 'origin/master'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

    new file:   .vim/.netrwhist
    new file:   .vim/.vimrc
    new file:   .vim/.ycm_extra_conf.py
    new file:   .vim/.ycm_extra_conf.pyc
    new file:   .vim/bundle/Vundle.vim
    new file:   .vim/bundle/YouCompleteMe
    new file:   .vim/bundle/ctrlp.vim
    new file:   .vim/bundle/molokai
    new file:   .vim/bundle/nerdtree
    new file:   .vim/bundle/tagbar
    new file:   .vim/bundle/ultisnips
    new file:   .vim/bundle/vim-airline
    new file:   .vim/bundle/vim-colorschemes
    new file:   .vim/bundle/vim-fugitive
    new file:   .vim/bundle/vim-json
    new file:   .vim/bundle/vim-snippets
    new file:   .vim/colors/molokai.vim
    new file:   .vim/colors/solarized.vim

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)
  (commit or discard the untracked or modified content in submodules)

    modified:   .vim/bundle/vim-snippets (modified content)

它认为git不会将这些视为目录,为什么?

4 个答案:

答案 0 :(得分:1)

add --all无法添加隐藏文件或目录(即以点开头的文件或目录)。您需要按名称(或至少像.*这样的模式)明确添加它们。

(偏离主题,但可能有帮助:我使用homesick gem进行点阵管理。它可以自动完成你现在手工做的很多事情。)

答案 1 :(得分:1)

如果要以递归方式添加目录及其中的所有文件,则必须在"py_thr_local.py", line 14, in __init__命令中指定目录名称。

add

答案 2 :(得分:1)

您可以使用的最佳方式是:

 git add *

 git add <directory name>

答案 3 :(得分:0)

最后,我找到了原因。我使用vundle来管理我的vim和.vim /文件夹。因此,在每个&#34; subdir&#34;中使用git的服务,并且在每个&#34; subdir&#34;中使用.gitignore,它实际上忽略了&#34; subdir&#中的这些内容34。