Replies: 2 comments
|
I agree that for a larger project, separating the models, schemas, and repositories into modules can make the codebase easier to navigate and maintain. For example, instead of having everything in large files like: you could organize it around each domain/entity: or, if you prefer keeping everything related to one entity together: I personally prefer the second approach once the number of entities grows, because changes related to one domain stay together. For removing the For upstream merges, I would keep your project-specific changes as isolated as possible. Then when you pull changes from the template: git fetch upstream
git checkout main
git merge upstream/mainIf the template changes files that you have substantially reorganized, Git cannot always determine that the changes belong to their new locations, so some manual conflict resolution is expected. Another option is to treat the template as a starting point rather than something that you continuously merge. Once your project has diverged significantly, manually reviewing the important upstream changes can be much less painful than repeatedly trying to merge the entire template. So I think the best approach depends on how closely you want to track the template: if you want frequent upstream updates, minimize structural divergence; if your project has become substantially customized, maintaining your own structure and selectively applying useful upstream changes may be simpler. |
|
To add to @brians930617's good points on domain organization, here are concrete Git and project strategies to eliminate the recurring friction with Why the Conflicts HappenWhen you delete
This produces recurring Strategy 1: Use
|
Uh oh!
There was an error while loading. Please reload this page.
First Check
Example Code
Description
I used the template in 4 different project, but in all of them I find the same problem:
These 2 actions are kinda boring with git merge --upstream.
Since (my personal opinion) the division in sub folder is more optimal for a big project, why not adopt it instead of using backend/app/crud-models.py files?
Something like
backend/app/model-schema-repo/user.py
Moreover, any suggestion for the --upstream merge? Just do it by hand and do not merge the changes?
Operating System
Linux
Operating System Details
No response
Project Version
last one
Python Version
No response
Additional Context
No response
All reactions