Re: post-receive for web deployment

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



After some playing I found using git clone to export to the staging
path and then doing git checkout -f master for the production path
keeps the files in the production tree clean while leaving any
un-tracked files in tact, seems what
Johannes said was true and this seems like a simple workaround... not
sure about working with indexes like he pointed out.

echo "Resetting staging tree"
rm -rf staging.git $staging_path
git --work-tree=$staging_path clone ./ staging.git


echo "Resetting production tree"
git --work-tree=$live_path checkout -f master


On Mon, Dec 19, 2011 at 2:35 AM, Sitaram Chamarty <sitaramc@xxxxxxxxx> wrote:
> On Mon, Dec 19, 2011 at 8:12 AM, Stephen Major <smajor@xxxxxxxxx> wrote:
>> Hello,
>>
>> I am having some difficulty understanding what I am doing wrong when
>> working with git to deploy a website through the use of a post-receive
>> hook on the remote.
>
> The most common issue I have seen in cases like this is that you need
> to 'unset GIT_DIR'.  In fact, anytime you play around with running
> stuff from *inside* a hook that works fine when you run it from
> outside, you need to check what GIT_ variables are present.
>
> I believe 'unset `git rev-parse --local-env-vars`' is a good idea too;
> probably much simpler.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]