首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何将vim插件添加到git repo中?

如何将vim插件添加到git repo中?
EN

Stack Overflow用户
提问于 2013-05-07 10:26:02
回答 1查看 638关注 0票数 1

我创建了一个git存储库并添加了vim-plugins (由vundle安装),在我将这个存储库推送到github,并将这个存储库克隆到另一台服务器后,我发现vim-plugin的目录是空的,vim-plugin目录下的目录和文件都丢失了

如何制作它:

代码语言:javascript
复制
$ 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
  #

如您所见,仅添加了目录。

代码语言:javascript
复制
$ git commit -m'test'
$ git push -u origin master

如果您在另一个位置克隆此存储库,则只存在空目录。

这是test vimgitrepo github page

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2013-05-07 10:38:25

您将整个目录复制到您的存储库中,这些目录是其他git存储库,其中包含.git/目录。

所以你有两种方法来解决这个问题:

在第一次提交之前,请使用命令git submodule将它们设置为

  1. git submodule中的.git/
票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16410289

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档