14

I'm trying to install utilsnips.

When I type:

cd ~/.vim/ 
git submodule add https://github.com/SirVer/ultisnips bundle/ultisnips 

I get this message:

You need to run this command from the toplevel of the working tree.

Why? How can I avoid it?

Katsu
  • 1,548
  • 4
  • 17
  • 28
  • possible duplicate of [How do I add a submodule to a sub-directory?](http://stackoverflow.com/questions/9035895/how-do-i-add-a-submodule-to-a-sub-directory) – glts Sep 22 '13 at 10:07
  • @glts: I looked it before posting. But it doesn't answer my issue. – Katsu Sep 22 '13 at 10:12
  • 1
    It's the same question. Your `~/.vim` is not the root of your Git repo (is it a symlink?). Try `cd ..` followed by the `git submodule` command until you find the "toplevel of the working tree". – glts Sep 22 '13 at 10:20
  • In fact there aren't git repo that's why I can't do it. Thank's for help. I will try the second way with `bzr` command – Katsu Sep 22 '13 at 10:28
  • If there is no Git repo, why are you trying to add a Git submodule? Install it manually, you don't need `git submodule` to install Vim plugins, just unzip in your `~/.vim`. – glts Sep 22 '13 at 10:32
  • That's what I did after seeing that's not a git repo. I follow Using Bzr install (in http://www.vim.org/scripts/script.php?script_id=2715). Next when i type `:helptags ~/.vim/ultisnips_rep/doc` or `:help UltiSnips` on vim nothing appear – Katsu Sep 22 '13 at 10:36
  • Solved by using `:BundleInstall 'UltiSnips'` comand on vim – Katsu Sep 22 '13 at 10:40

2 Answers2

11

Your .vim directory might not be a git directory. To make it a git directory simply:

git init

Then you can run:

git submodule add https://github.com/SirVer/ultisnips bundle/ultisnips
cforbish
  • 7,499
  • 2
  • 23
  • 29
8

You might be running the command from a subdirectory. Make sure you are in the directory same level as the .git directory.

birch3
  • 91
  • 1
  • 4