Skip to content

Instantly share code, notes, and snippets.

@DarrenN
Forked from elasticdog/gist:8806073
Created February 4, 2014 15:47
Show Gist options
  • Save DarrenN/8806202 to your computer and use it in GitHub Desktop.
Save DarrenN/8806202 to your computer and use it in GitHub Desktop.
ADD NEW SUBMODULE
==============
$ git submodule add http://github.com/scrooloose/nerdtree.git vim/bundle/nerdtree
$ git submodule init
$ git commit -m 'add nerd tree plugin as submodule'
UPDATING
======
Git submodules are locked to specific commits in their respective
repositories...in other words, updating the parent repo will not do the same
for that project's submodules.
Running `git submodule update` only makes sure that the submodules are at the
specified cached revision, not the upstream latest. To actually update all of
your submodules to the latest upstream HEAD revisions:
$ cd ~/.dotfiles/
$ git submodule foreach git fetch
$ git sumbodule foreach git merge origin/master
$ git commit -a -m 'Update all submodules to latest upstream HEAD revision'
$ git push
REMOTE MACHINE
--------------
$ cd ~/.dotfiles
$ git pull
$ git submodule update
STATUS INFO
========
$ git submodule status
$ git ls-files --stage
REMOVE
======
To remove a submodule from your repository, you must edit the obvious
.git/config and .gitmodules files, but also run this command to finish the job:
$ git rm --cached path/to/submodule
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment