Will the branches remain separate from now on? If they will remain separate, fell free to create two new branches from main, say A and B. Then, in main, delete the 2 folders, and in each of the separate branches do the necessary adjustments... say, in A
git checkout A git rm readme.md git rm Folder_B git commit -m "Removing unnecessary stuff from this project"
This should be good enough. This way you get to keep the history of the common development up to this point in all 3 branches. If you don't want that and you would rather have them separate from the beginning as separate projects, then you should consider using git filter-repo https://github.com/newren/git-filter-repo