- From: Daniel DeLeo <
>
- To:
- Subject: [chef] Re: Re: Strange git behavior - any suggestion is welcome
- Date: Mon, 16 Mar 2015 09:12:32 -0700
On Monday, March 16, 2015 at 5:49 AM, Jeff Byrnes wrote:
>
Tony,
>
>
This is the default behavior for the git resource. If you take a look at
>
the docs, you’ll see the checkout_branch attribute, whose description
>
reads: “Use to specify the name of a branch to be checked out. Default
>
value: deploy.”
>
>
So, instead of using the revision attribute, you may, instead, want to
>
specify the checkout_branch attribute.
>
>
What is happening right now is that it’s checking out a branch called
>
deploy from the revision you’ve set, but that’s a bit confusing, based on
>
what you’re expecting to see.
>
>
-- Jeff Byrnes
Jeff is correct. The deploy resource does this because you may check out tags
or pull from branches in a way that would normally cause a git error, for
example if you force pushed to a branch. If you’re just pulling a git repo to
a server, you don’t need to care about the deploy branch, since it will be
forcibly set to the correct git rev based on the reference you specified
(which you can verify for yourself with git log and git rev-parse and git
ls-remote).
The checkout_branch feature is useful if you’e setting up developer laptops
and you want to fetch all your git repos to a standard location and leave
them on master.
--
Daniel DeLeo
Archive powered by MHonArc 2.6.16.