You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Now when we do copier copy on an existing project we can decide to override an already existing file or skipping it, but not merging the content of the 2 files
Desired Situation
It would be great if we could merge those two files, maybe putting conflict markers on the whole content of the existing file and the new content from the template.
This would be very useful in files like .gitignore or .tool-versions.
Proposed solution
No response
The text was updated successfully, but these errors were encountered:
I don't think it's possible to merge two files with zero common history. There's your existing file with its own Git history, and there's the freshly generated file from copier copy. You can easily get a diff from your file to the new file, but I don't see how you could merge the two 🤔 I suppose your project is tracked by Git, so just overwrite and then stage or unstage parts of the diff manually, just like you would manually resolve conflicts.
The use case I hade in mind was to generate a project with template-1 and put in its tasks a command to add to the same project the template-2, but those 2 template have files that needs to be merged (e.g.: .gitignore and .tool-versions). But since the tasks are run just after the copy of template-1, it is not yet git tracked.
Right, templates that modify the same files is an unsolved problem yet 🙂
Your tasks could definitely git init; git add -A; git commit -m initial before applying the second template. Then nothing prevents the user from deleting the .git folder once they manually "merged" relevant files, to start fresh again.
Actual Situation
Now when we do copier copy on an existing project we can decide to override an already existing file or skipping it, but not merging the content of the 2 files
Desired Situation
It would be great if we could merge those two files, maybe putting conflict markers on the whole content of the existing file and the new content from the template.
This would be very useful in files like
.gitignore
or.tool-versions
.Proposed solution
No response
The text was updated successfully, but these errors were encountered: