create a folder named 'Repository Templates' under your Portal/# folder and place your template files in folders there. The logic for loading templates is to look in the /Portals/#/Repository Template/[templatename] folder first, and if not found, then look in /DesktopModules/Repository/Templates/[templatename].
You can even place partial templates under the Portals structure, for example...
Assuming your setting up a customized version of the default template for portal #2
1. Create a new folder... /Portals/2/Repository Templates/default
2. copy just the 2 files, template.html and template.xml from /DesktopModules/Repository/Templates/default to the new folder
3. modify those 2 files in the Portals folder
4. now, in the Module Settings page for a Repository module on Portal 2, you'll see that the default template has an asterisk next to it indicated that it's using a customized version
when the template files are loaded, the template.html and template.xml files will be loaded from the Portals folder and all the rest of the template files will be loaded form the DesktopModule folder.
Of course, you can also create an entirely new template and place all of the files in the Portals folder structure.