我创建了一个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
#如您所见,只添加了dir。
$ git commit -m'test'
$ git push -u origin master如果您在另一个位置克隆此存储库,则只存在空目录。
发布于 2013-05-02 13:51:10
在将其推送到GitHub之前,您需要确保已添加这些文件并将其提交到本地存储库中。
参见示例"GIT add vs push vs commit“。
并确保您的目录(如.vim/bundle/vim-powerline)不为空(否则,它们不会被添加到索引中:只能对文件进行版本控制)
还要检查这些目录中的文件是否已经被忽略(被.gitignore文件忽略)。
如“在git中显示忽略的文件”中所述,执行a:
git clean -ndX列出不会添加的文件。
最后,不是那些是symlink的目录会被添加为文件。
这就解释了:
参见"What does git do to files that are a symbolic link?":
git只是将链接的内容(即它所链接的文件系统对象的路径)存储在一个'blob‘中,就像它对普通文件所做的那样。
然后,它将名称、模式和类型(包括它是符号链接的事实)存储在表示其包含目录的树对象中。
发布于 2015-02-19 18:39:21
你使用vundle作为插件管理器吗?
我遇到了同样的问题,问题是vundle,我不知道病原体是否做了同样的事情,克隆github存储库并将.git文件包含到插件目录中,因此该目录的内容不包括在您的项目中。
我用这个序列来解决这个问题:
并且我所有的插件目录都包含在内。
它能解决你的问题吗(我希望是这样)?
发布于 2013-05-02 19:25:46
你可以用这个命令来代替git push吗?git推送源站
同样,如果你想在不同的机器上共享你的vim插件,你可以尝试另一个问题How to share one vimrc file among multiple clients?中提到的解决方案
https://stackoverflow.com/questions/16330951
复制相似问题