1

git レポジトリを作成し、(vundle によってインストールされる) vim-plugins を追加しました。このレポを 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

そして、このレポを別の場所にクローンすると、空のディレクトリしか存在しません。

これはテストvimgitrepo githubページです

4

1 に答える 1

4

ディレクトリ全体をリポジトリにコピーしました。これは他の git リポジトリであり、その中に.git/ディレクトリが含まれています。

したがって、それを解決するには2つの方法があります。

  1. コマンドgit submoduleを使用し、それらをサブモジュールとして設定します。
  2. .git/最初のコミットの前に、これらのディレクトリの を削除してください。
于 2013-05-07T02:38:25.037 に答える