1

I created a git repo and add vim-plugins ( which is installed by vundle) into it, after I pushed this repo to github, and clone this repo to another server, I found that vim-plugin's directory is empty, dirs and files under vim-plugin's directory are all missing

How to produce it:

$ 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
  #

As you can see, only dir are added.

$ git commit -m'test'
$ git push -u origin master

And if you clone this repo on another place, only empty directory exists.

Here is github page

3
  • Could you share that github repo's address so that we can test it ourself? Commented May 2, 2013 at 7:38
  • @romainl, There's nothing but an empty vim-powerline directory in that repo...But you can test follow above instructions. All you just need to do is install vim-powerline or whatever vim-plugins using vundle.Thanks. Commented May 2, 2013 at 7:45
  • Hmm, no thanks, I don't use vundle. How did these plugins get there? Using :BundleInstall or using $ git clone? Commented May 2, 2013 at 9:16

3 Answers 3

1

You need to make sure you have added those files and committed them in your local repo before pushing it to GitHub.
See for example "GIT add vs push vs commit".

And make sure that your directories (like .vim/bundle/vim-powerline) aren't empty (otherwise, they wouldn't be added to the index: only files can be versioned)

Also check if the files in those directories aren't already ignored (by a .gitignore file).
As explained in "Show ignored files in git", do a:

git clean -ndX

To list the files that would not be added.

Finally, not that directories which are symlinks would be added as file.
That would explain:

  • why your git status mentions a new file, and
  • why a clone of that repo display an empty directory.

See "What does git do to files that are a symbolic link?":

git just stores the contents of the link (i.e. the path of the file system object that it links to) in a 'blob' just like it would for a normal file.
It then stores the name, mode and type (including the fact that it is a symlink) in the tree object that represents its containing directory.

Sign up to request clarification or add additional context in comments.

6 Comments

Yes, I added and it's not empty. I tried again. And I found after I git add ., git only shows : new file: .vim/bundle/vim-powerline, I'm sure .vim/bundle/vim-powerline is not empty.
@nfpyfzyf did you and, and commit? And are the files you are trying to add already ignored (by a .gitignore file)
Yes, and it's not in .gitignore file.
@nfpyfzyf are those files visible in your GitHub repo, once you have pushed them?
In the example above, it's not a symlink, I hard copy the vim-powerline into test git repo.
|
1

Are you using vundle as plugin manager?

I experienced the same problem and the issue was that vundle, I don't know if Pathogen does the same, clone the github repositories and includes the .git file into the plugin directory, so the directory's content is not included in you project.

I solve this issue with this sequence:

  1. 'find . -name .gitignore -exec rm -rf {} \;', to remove all .git directories.
  2. 'git init' to init repo (I remove all. git folders in step 1).
  3. git add . (add all files again).

And all my plugin directories were included.

Does it solve your problem (I hope so)?

Comments

0

can you try with this command in place of git push. git push origin master

Also if you want to share your vim plugin across different machine you can try the solution mentioned in another question How to share one vimrc file among multiple clients?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.