我创建了一个git存储库并添加了vim-plugins (由vundle安装),在我将这个存储库推送到github,并将这个存储库克隆到另一台服务器后,我发现vim-plugin的目录是空的,vim-plugin目录下的目录和文件都丢失了
如何制作它:
$ make a new test user in Linux, then ( su - test )
$ git clone https://github.com/gmarik/vundle.git ~/.vim/bundle/vundle # install vundle
$ echo "
set nocompatible
filetype off
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
Bundle 'gmarik/vundle'
Bundle 'Lokaltog/vim-powerline'
filetype plugin indent on
" >> .vimrc
$ vim # run vim command `:BundleInstall`
$ mkdir vimgitrepo && cd vimgitrepo && git init
$ cp -a ~/.vim/bundle .
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# bundle/
nothing added to commit but untracked files present (use "git add" to track)
$ git add .
$ git status
# On branch master
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# new file: bundle/vim-powerline
# new file: bundle/vundle
#如您所见,仅添加了目录。
$ git commit -m'test'
$ git push -u origin master如果您在另一个位置克隆此存储库,则只存在空目录。
发布于 2013-05-07 10:38:25
您将整个目录复制到您的存储库中,这些目录是其他git存储库,其中包含.git/目录。
所以你有两种方法来解决这个问题:
在第一次提交之前,请使用命令git submodule将它们设置为
git submodule中的.git/。https://stackoverflow.com/questions/16410289
复制相似问题