1

I have a git repository for a Joomla component that I am developing. The whole thing is set up like this:

joomla_www/
    administrator/
    bin/
    cache/
    .
    .
    .
    MY_COMPONENT/
    .
    .
    .
    templates/

My git repo is initialized at MY_COMPONENT/.

Now we have realized that we would like to add templates/ to the repo too, which brings two problems:

1) How to move the git repo's root folder one level above. About this, I've already read this question... except that I don't understand the accepted answer (the one by Tim Henigan). I don't understand the first step (he is talking about the remote repo, not the local one, right?), and I don't understand the second step (am I supposed to move everything in MY_COMPONENT/ to the root Joomla folder... and commit from there?).

2) How to make git ignore the myriad folders that Joomla has so that it only pays attention to the two ones that I'm interested in, MY_COMPONENTand templates/. I know about .gitignore, but in this case, when the majority of the contents in a folder are ones that I am NOT interested in, it's kind of a pain to have to add everything manually in it. Is there a simpler solution? Something like the opposite of .gitignore, a file where you just put the folders you are interested in?

EDIT: I forgot to ask. After performing whatever changes in the remote git repo, what would the rest of us developers have to do to sync up? Would it be enough to do just a 'git pull'?

EDIT 2: okay, found an answer to my second question: Make .gitignore ignore everything except a few files. Now I only need some kind person to clarify the answer I found to the first one.

Community
  • 1
  • 1
PaulJ
  • 1,646
  • 5
  • 33
  • 52

1 Answers1

-1

Probably the easiest solution is to move the templates directory into the MY_COMPONENT directory. Add and commit

Then in joomla_www create a symbolic link to the templates.

Roland Smith
  • 42,427
  • 3
  • 64
  • 94
  • There is already another `templates/` folder Inside `MY_COMPONENT`, which I also need to track. – PaulJ Feb 08 '17 at 18:09
  • @PaulJ Then give the moved templates folder another name. It shouldn't matter. – Roland Smith Feb 08 '17 at 18:14
  • 1
    That solutions sounds like a recipe for a mess down the line, when I (or another developer) forget that we have moved the folder, or forget to set up the symlink, or... Not to mention that we have to upload the site to our hosting provider via FTP, and we can't create the symlink using a FTP client. – PaulJ Feb 08 '17 at 21:01