【发布时间】:2016-09-25 04:50:49
【问题描述】:
我只想在我拥有的每台计算机上同步我的 .vim 文件夹。这些就是我为此目的所做的: 1. cp -r ~/.vim ~/GitRepository/ 2. cd ~/GitRepository 3. git add --all 4. 提交和推送。但是当我检查我的 github 时,这些文件应该在 /.vim/subdir/sub-subdir 下丢失了。那些子目录变成了空的。尽管我没有 .gitignore 文件,但link 中的建议对我没有帮助。
当我输入 git status 时。这些注释出现:
─➤ 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 无法将这些识别为目录,为什么?
【问题讨论】:
-
如果你没有 .gitignore 并且不关心任何虚拟文件,你可以试试
git add . -f