How To Fork A Yii2 App?

I would like to create a custom version of the Yii2 basic app.

But since this repo is read-only, do you guys have any advice about the best way to "fork" a Yii2 app?

For sure I can clone the whole Yii2 repo and work in the apps/basic folder, but that’s not a real solution for me.

In fact, I wanted to share a wiki or even a complete build of the custom app setup that I used once as well.

Agree the repos are read only… but curious why one would need to worry about that - because any other app specific changes should be negligible in Yii Basic App, except maybe the config folders

So if you fork for example yii2-app-basic and create your own for composer install. Composer will anyway handle updates to the vendor folders. You can manage any other changes to the other parts of this repo yourself.

Personally I installed a fresh Yii app and did the changes there and kept a Yii app template for reuse. Not sure if this helps.

[size="2"]So, I found git sparsecheckout via http://stackoverflow…13738951/291573, which does a part of the job…[/size]



mkdir yii-sparse

cd yii-sparse/

git init

git remote add origin

git config core.sparsecheckout true

echo apps/basic  >> .git/info/sparse-checkout

git pull origin master

[size=2]The commands above gives you the following structure:[/size]


└── apps

    └── basic

        ├── assets

        ├── commands

        ├── config

        │   └── codeception

        ├── controllers

        ├── models

        ├── runtime

        ├── tests

        │   ├── _data

        │   ├── _helpers

        │   ├── _log

        │   ├── _pages

        │   ├── acceptance

        │   ├── functional

        │   │   └── _pages

        │   └── unit

        │   	└── models

        ├── vendor

        ├── views

        │   ├── layouts

        │   └── site

        └── web

            ├── assets

            └── css

Now, the "only" thing would be to move the basic folder to your repo root, but I am afraid this is much more tricky than it looks.

But also have a look at the basic-app commits, not everything there is app specific [size="2"][/size]

Just curious, what exactly is the difference of a read-only repo? I forked it as normal but now I’m wondering what downsides there are.

It makes no sense to send a PR to the read-only repo. Because the core devs would have to merge the changes manually back in to the development repo.

You can create your own repo with a git subtree merge of the yii2 development repo and work on that. theoretically the read-only subtrees of yii2-app-* repos could be merged back into the main repo when we want to have the changes but as the current split strategy is optimized for speed and not for functionality there is no waranty that it will work.

As far as I see git subtree is the only suiteable solution right now.