You don’t have to fork a whole copy of each user’s fork of cookbooks to
collaborate on community cookbooks, however. An easy way to do this, is
set up a remote for the user you want to fetch from, add a tracking
branch, push your changes back to your own origin, and finally do a pull
request. It may be a little confusing but its not as hard as it sounds.
First go find the user’s cookbook repo you want to fork, there you can
find the read-only git link for that user’s fork. Since you brought up
my yumrepo branch earlier on the mailing list, I’ll use that as an
example here. Assuming you already have a local clone of your own
opscode/cookbooks fork, then you can go into your local repository and
manipulate a branch to point
Add a remote named “apenguin”
- git remote add apenguin git://github.com/atomic-penguin/cookbooks.git
Fetch all the tags and branches from the user’s upstream cookbook repo.
- git fetch apenguin
Add a local tracking branch for apenguin/yumrepo branch
- git branch --track yumrepo apenguin/yumrepo
Switch to your newly tracked local branch. Do a pull to update your
local tracking branch.
4) git checkout yumrepo; git pull yumrepo
Make change, stage change, commit change
- git add .; git commit -m “Making changes”
Push change to a new branch on your own fork of opscode/cookbooks.
Assuming your own remote is “origin”.
6) git push origin yumrepo:yumrepo
At which point you can proceed to do a pull request through the github
Eric G. Wolfe
Senior Linux Administrator,
IT Infrastructure Systems
Marshall University Computing Services
Drinko Library 428-K
One John Marshall Dr.
Huntington, WV 25755
Civilization is the limitless multiplication of unnecessary necessities.
– Mark Twain
On 10/15/2011 03:21 PM, Bryan Berry wrote:
damn, i was hoping that 1) i misunderstood u on irc and 2) there was
magic that I was missing
On Sat, Oct 15, 2011 at 9:19 PM, Noah Kantrowitz <email@example.com
On Oct 15, 2011, at 11:42 AM, Bryan Berry wrote:
> I am trying to figure out how to "vendor branch" technique to
push my changes upstream cookbook.
> Here is the workflow that I have in mind
> $ knife cookbook site install <cookbook>
> $ vim cookbooks/<cookbook> #make changes
> $ git checkout <cookbook>-vendor
> $ git checkout master path/to/modified-cookbook
> $ git commit -am 'merging select files into vendor-branch'
> However, when I do $ git checkout chef-<cookbook>-vendor &&
> git seems to be tracking everything in this branch, not just the
files for the cookbook.
> I have read through
but it still isn't clear to me how to push my changes to the
upstream cookbook. Perhaps I am missing something completely
obvious. Can someone enlighten me?
> The only other alternative I see is to track down the source of
cookbook, fork it, create a patch from my code, apply it to my
fork, send a pull request.
As I explained on IRC, that is indeed the way to do it. The
management in the cookbook repo is purely as an installed artifact
-----BEGIN PGP SIGNATURE-----
-----END PGP SIGNATURE-----