git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Maintaining an html branch
@ 2010-05-25  6:43 Christos Trochalakis
  2010-05-25 19:21 ` Jonathan Nieder
  0 siblings, 1 reply; 2+ messages in thread
From: Christos Trochalakis @ 2010-05-25  6:43 UTC (permalink / raw)
  To: git list

Hello,

I would like to maintain an html branch for my repo, containing files
under my '_site/' dir that is not version controlled.

Below is a first draft that works, but as I am not really familiar
with git plumbing, I'd appreciate any comments on a better way or
style to to write it.

#!bash
jekyll --no-auto             # build the static website on _site/ dir
rm .git/html.index
export GIT_INDEX_FILE=.git/html.index
git add -f _site
tree_id=$(git write-tree --prefix=_site/)
new_commit=$(echo "New website"|git commit-tree $tree_id -p html)
git update-ref html $new_commit
rm .git/html.index

Thanks,
Chris

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Maintaining an html branch
  2010-05-25  6:43 Maintaining an html branch Christos Trochalakis
@ 2010-05-25 19:21 ` Jonathan Nieder
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Nieder @ 2010-05-25 19:21 UTC (permalink / raw)
  To: Christos Trochalakis; +Cc: git list

Hi Christos,

Christos Trochalakis wrote:

> I would like to maintain an html branch for my repo, containing files
> under my '_site/' dir that is not version controlled.
[...]
> rm .git/html.index
> export GIT_INDEX_FILE=.git/html.index
[...]

Looks reasonable.  Way I suggest a simpler way?

If your goal is to publish an html branch with the rest of your
branches, I would recommend using a separate local repository that
pushes to the same remote repository[1].

If the goal is to stay under draconian disk quotas by not maintaining
two local repositories, one with the web site checked out all the
time, I suggest using contrib/workdir/git-new-workdir.

Hope that helps,
Jonathan

[1] See http://thread.gmane.org/gmane.comp.version-control.git/142831/focus=142865
for an example.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-05-25 19:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-25  6:43 Maintaining an html branch Christos Trochalakis
2010-05-25 19:21 ` Jonathan Nieder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).