From: Junio C Hamano <gitster@pobox.com>
To: Jerome Yanga <jerome.yanga@gmail.com>
Cc: Neal Kreitzinger <nkreitzinger@gmail.com>, git@vger.kernel.org
Subject: Re: git push from client is not updating files on server
Date: Tue, 06 Mar 2012 18:23:34 -0800 [thread overview]
Message-ID: <7vpqcpp2s9.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CAC0z1F9sBYCuv_HMCx1ryWLvxZKUcLPS1UUj80ihEesje+SKzg@mail.gmail.com> (Jerome Yanga's message of "Tue, 6 Mar 2012 16:28:06 -0800")
Jerome Yanga <jerome.yanga@gmail.com> writes:
> The project in Apache's DocumentRoot was created using the following command:
>
> "cd /var/www/git
> git clone --bare <non-bare working directory> <project>.git"
>
> Hence, I believe that is is bare. Besides, it does not have .git
> folder. I assumed that when I did this that the non-bare directory
> will also be updated when a push is performed via http.
>
> My objective is that I would like the developers to be able to push
> via http and these pushes will need to be reflected on the non-bare
> working directory as these directories will be used for automated
> tests.
So that <non-bare working directory> above is what you want to be
updated when you update <project>.git?
More concretely, for example, you have say /srv/project/frotz and
/var/www/git/frotz.git directories on that server. Perhaps the
project may have started in the former:
mkdir -p /srv/project/frotz
cd /srv/project/frotz
git init
... populate with the sources ...
git add ...
git commit
and then cloned to the other one
cd /var/www/git && git clone --bare /srv/project/frotz frotz.git
I'll assume that is more or less the set-up you have.
Now, it depends on how the push goes to the latter one (I do not
remember offhand if pushing over dumb http transport triggers
hooks), but in general, you would install a post-update hook (read
githooks manual page) in the latter repository, that gets triggered
when it receives a push. The hook could do something like this:
#!/bin/sh
unset GIT_DIR
cd /srv/project/frotz &&
git pull --ff-only /var/www/git/frotz.git master &&
: you can trigger automated test here if you want to &&
make test
The above example goes to the repository with a working tree, pulls
the latest change from the repository the user pushed into, and then
runs the automated test.
next prev parent reply other threads:[~2012-03-07 2:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-06 16:52 git push from client is not updating files on server Jerome Yanga
2012-03-06 17:46 ` Ben Tebulin
2012-03-06 19:35 ` Junio C Hamano
[not found] ` <CAC0z1F-Eg2DOLvd3aA5XCoEJjj1jC=VWVkTA+uc24=18h3pN7g@mail.gmail.com>
2012-03-06 20:37 ` Junio C Hamano
2012-03-06 21:12 ` Neal Kreitzinger
2012-03-06 21:21 ` Neal Kreitzinger
[not found] ` <CAC0z1F_eyMo4D8E2j15dOFhp-6tZ_ixacB6XcKfNpJategcsXQ@mail.gmail.com>
[not found] ` <CAC0z1F_LYRkReO1qqcjkWy6Vb3E0_oNo-0kSf15nGfQFAtXpdg@mail.gmail.com>
2012-03-06 23:07 ` Jerome Yanga
2012-03-06 23:32 ` Neal Kreitzinger
2012-03-07 0:28 ` Jerome Yanga
2012-03-07 1:11 ` Neal Kreitzinger
2012-03-07 2:23 ` Junio C Hamano [this message]
2012-03-07 2:34 ` Neal Kreitzinger
2012-03-07 11:04 ` Holger Hellmuth
2012-03-07 15:43 ` Jerome Yanga
2012-03-30 18:23 ` Jerome Yanga
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vpqcpp2s9.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=jerome.yanga@gmail.com \
--cc=nkreitzinger@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).