0

I was following the guide from here John Anderson Vim Setup to help setup vim. he steps through adding the various submodules to git in the format

git submodule add http://github.com/tpope/vim-fugitive.git bundle/fugitive

since completing his guide I have made further changes. Getting ahead of myself I am on ubuntu my path is ~/.vim and I used the exact {autoload,bundle} setup as described in the guide.

I want to include the changes I added in my ~/.vimrc and the ohther bundles I have installed into my github so I can clone it and go on any other PC.

Really struggling to figure out how to get the changes in git. For example in my ~/.vim/bundle/ directory it has two new folders delimitMate and colorschemes. However when I do git push it returns everything as up to date.

What am I missing?

sayth
  • 6,696
  • 12
  • 58
  • 100

2 Answers2

4

Those are submodules, I figure. What you need to do, is:

# To add new modules
git add .gitmodules
git commit -m "Add new bundles"
# To add changes in vimrc
git add vimrc
git commit -m "Update my vimrc"
# To upload to Github
git push origin

On another PC, after cloning/pulling the Github repo, you need to:

git submodule init
git submodule update

To pull new changes to submodules you can later:

git submodule foreach git pull origin master
# NOTE: no trailing slash!
git add bundles/fugitive
git add bundles/etc
git commit -m "Update bundles"
git push

You can reduce the many adds by the following command:

git ls-files -m bundles | xargs git add
dmedvinsky
  • 8,046
  • 3
  • 31
  • 25
  • Thanks that worked well. Because my .vimrc is in ~/ and my git repo is in ~/.vim/.git I had to copy the file into the ~/.vim/ folder. There isn't anyway to add the ~/ other folder to the repo is there? – sayth Nov 12 '11 at 10:00
  • You can store your `vimrc` in the repo, and make a symlink in the $HOME, like `cd $HOME && ln -s .vim/vimrc .vimrc` – dmedvinsky Nov 27 '11 at 08:48
1

Try:

git submodule update
git add delimitMate colorschemes [and any other file names]
git commit -m "My changes"
git push origin master

Pushing is for a remote repository. Committing will commit to your local repo. Changes must be committed locally first before you can push to a remote repository.

Ishpeck
  • 2,001
  • 1
  • 19
  • 21