tags:

views:

203

answers:

1

I have cloned a git repo which has my emacs config files in. I would like to add pylookup in a subdirectory. What is the correct way to do this?

Below are the options I can think of.


  1. If I clone it into ~/.emacs.d/pylookup/ and add that folder to my emacs repo, will that update properly when I do:

    cd ~/.emacs.d/pylookup/
    git pull
    cd ~/.emacs.d
    git commit -a -m "updates to pylookup"
    git push
    

    i.e. when I pull those changes on my other machines will I have the new version of pylookup?

  2. Do I simply get my emacs repo to ignore pylookup/* and update it on every machine whenever pylookup is updated. This would get annoying if there was a few repo's and a few machines but I can live with it.

  3. Is there some smart tricks with git submodule. If so could you provide an explanation I didn't really understand the documentation. How would I pull changes for emacs and for pylookup.

  4. Do I go with answer 2 but make a script to update all sub-repos. If I did that I could run that once on each machine every time pylookup changed.


Couple of possible related posts.

+2  A: 

If you create a Git submodule:

$ git submodule add git://github.com/tsgates/pylookup.git pylookup
$ git submodule init pylookup
$ git submodule update pylookup

Let's say there are some changes to pylookup and you want to get them:

$ cd pylookup
$ git pull origin master
$ cd ..
$ git add pylookup
$ git commit -m "Track new commit of pylookup"
Ben James
Good answer. What happens on my other computer when I do pull the emacs changes. i.e. do I have to update pylookup on every machine.
James Brooks