Say, if a project using Git is all committed, with master and foo branch both point to the same commit. If we are now on the master branch, and change some files, it seems that we can switch to the foo branch, or even create a new branch:
git checkout -b bar
and commit the changes to any of the 3 branches? So it is like, the changes remain “flexible” for the programming to commit to whichever branch chosen? (even commit to foo if there is one or several more commits already done in the foo branch, as long as the modified files didn’t overlap with any files in those commits).
Yes. You will be stopped from changing branches if there is a conflict. Otherwise, it Just Works.