Rich-Harris / degit

Straightforward project scaffolding
MIT License
6.93k stars 242 forks source link

Can degit handle template upgrading? #351

Open martin-braun opened 2 years ago

martin-braun commented 2 years ago

degit peeks my interest, because I can provide a git repository as template with no headache. I very much adore the fact that the user doesn't have to download the entire repository this way, but what about upgrading my template?

Say I bumped a lot of dependencies in my template. I might also changed the ground structure of my project scaffold slightly.

After a while a user decides to upgrade the template to get the latest nitty-gritty that my template offers. Ideally their way of doing this is just calling degit again. The hard part is that it must not overwrite files that have been changed, but produce the same merge-conflict output that git itself would give if I would try to pull from the upstream with rebase.

Since degit stores the previous download of the template with its hash in the user directory, it would use the old version to compare the files. It would also maintain a local database to know what template-hash the current project is using.

Have there ever been any thoughts about this? Are there plans or even existing solutions to the problem?

zyyv commented 1 year ago

Have the same issue.

Fred-Vatin commented 1 year ago

I had a similar question. How degit handle conflict ? Does it overwrite existing files ? Skip ? Merge ?