2

I am trying to push my .vim directory to github.

I am using pathogen ,so under .vim/bundle , I have some plugins , which are git repos too.

when I push to github they are converted to green folder icons (which as I understand are a ref to other repos).

here is a screen shot.

enter image description here

I want a full Backup of my .vim, so I could do git clone to my other machines too.

  • can I clone the repo from github full functional clone ? I get empty dirs under .vim/bundle.

  • or push it FULLY from my local machine , and avoiding those green folders all together ?

Ayed
  • 373
  • 5
  • 17
  • Try `git rm --cached bundle`, `git add bundle/*/`. – Chronial May 07 '13 at 15:00
  • first command deleted the files under bundle , second one added it again.So git status did not show any thing , should I commit and push again, if possible ? – Ayed May 07 '13 at 15:05

2 Answers2

4

Git will detect git repositories in subdirectories, and add them as such by default – only noting the SHA of their currently checked out commit. You can circumvent that behaviour by running git add subfolder/*. But this only works if the given subfolder is not currently part of the cache. So in your case you need to run these commands (assuming there are no spaces in your folder names):

git rm --cached bundle
ls --color=never bundle | xargs -t -n1 -I {} git add "bundle/{}/"
Chronial
  • 66,706
  • 14
  • 93
  • 99
  • Thank you !! I had to do it manually for every folder under bundle/ but it worked !! *note* that the xargs command did not work , here is the output fatal: pathspec 'bundle/{}/*' did not match any files. – Ayed May 07 '13 at 18:10
  • I edited the answer and add the right format of xargs command. – Ayed May 07 '13 at 18:57
  • Glad I could help, but I am confused – I tried that command before I posted it and it works for me. And I can’t see any edit? – Chronial May 07 '13 at 19:21
0

What does this green icon mean in a github repository?

Looks like submodule. Check for a file named .gitmodules at the source of your git.

If this file exists you need to clone the repository as following:

git clone address
git submodule init
git submodule update
Community
  • 1
  • 1
Vash2593
  • 129
  • 3