I am new to git and trying to understand the best practices about commits and merging.
Of course you shouldn't commit buggy changes to the master branch, and from what I understand you should create new branches for features / bug fixes in your project.
After testing how merging works, I see that when merging some branch B with branch A, branch A gets all previous commits of branch B in its log, but isn't that problematic if you are merging some experimental branch into your master branch ?
Because then it means that your master branch has in its history commits from experimental branch that were buggy, is this ok anyway or is it a common practice to exclude those commits when merging to master ?