I'm working on a specialized standalone server for imageboards, and have the local git repository folder as my development/testing folder. Is it possible to push a local file to the repository with a different name? For example, index.html.remote
(on the local repo) to index.html
(remote repo), since gochan uses template files to generate html pages. I could just create index.html
as an landing page for first time installation, push that, and then just replace that with a template-generated version and never push it again, but that seems a bit messy.
Asked
Active
Viewed 737 times
1
-
whats stopping you from using `index.html.remote` locally? Or perhaps a better name then would be `index.html.template` – vidstige Apr 10 '14 at 04:53
-
But having it as just index.html when a user first downloads it would look better than index.html.remote, wouldn't it? – eggbertx Apr 10 '14 at 04:55
-
Git doesn't push files, it pushes its tree – zerkms Apr 10 '14 at 05:48
1 Answers
0
But having it as just
index.html
when a user first downloads it would look better thanindex.html.remote
, wouldn't it?
You can achieve that. Simply version a:
- index.html.template
- a script which generates the right index.html (not versioned, private)
- a .gitattributes file in which you declare that content filter driver called here "
smudge
" (a script which runs ongit checkout
)
(picture from chapter "git Attributes" of the Git book)
echo 'index.html.template tpl' >> .gitattributes
git config --global filter.tpl.smudge yourScript
That way, you don't have to push different files to different remotes.
You manage only one file (a template file), and your script generates the right content depending on its execution environment.