I created a framework and two projects that depend on this framework (actually two script programs)
The framework needs to be placed in the root directory of the script.
The framework and scripts need to be changed frequently now.
Can Git create two different branches for two projects, and on each branch I can see the latest changes to the framework and the respective project (but not the other project)?
Can it Then create sub-branches for respective projects for development with different features of respective projects?
Of course you can do this. The code and introduction website of many open source projects are separated in this way on Github. Just add --orphan to Checkout, then clean up this completely independent branch, and the rest can be done on the isolated branch.
But as everyone suggested, it would be more reasonable to use two repos to handle your situation.
Why should two projects be put into one repo? You can use two repos, and then put the framework into the project as an external dependency.
If you have to use a repo, the easiest way is to use the framework as a submodule of git, and then have two projects and two branches, with the framework in the root directory. This makes it easier to modify.
It is recommended to read the Git tutorial carefully. Recommended address:
Git Tutorial
I guess you are an SVN or CVS user. Git's branching model is obviously different from SVN. It may be more suitable to use multiple Repos to implement functions similar to SVN "branching".
I will give you a simple GIT tutorial, which is enough for daily work. Portal:
Simple GIT tutorial
By the way, I will post my own GIT tutorial, which is very comprehensive. Geek Academy GIT series tutorials
Go directly to sourcetree. The graphical interface is more suitable for getting started. Once you are used to it, you can go to the command line and pretend to be awesome. Creating branches is very simple and clear graphically