Accessing data in git bare repo -
i've set remote server want push git commits to. i've set git init --bare
based on advice, noticed doesn't have files there (working tree) after content pushed there. aka. if have file called something.txt
, add , commit local repo, push remote repo, record commit can't see something.txt
on remote filesystem.
the problem want manipulate file remotely via hook. aka. once push branch, "update" hook read file in repo , send program.
at moment, can print file list remotely via git ls-tree --full-tree -r head
i'm not yet sure how view individual files or if should doing way (doesn't seem it's designed way).
if create remote repo without --bare
, error when trying push due lack of working tree.
of course can print file command line tools, want? can create local checkout (git clone $path-to-bare-repository $somewhere
).
if care 1 file, have @ git cat-file
, e.g.
git cat-file -p $id_from_ls_tree
as one-liner:
git cat-file -p $(git ls-tree --full-tree -r head | grep something.txt | awk '{print $3}')
Comments
Post a Comment