From the default master
branch, I created another branch division_feature
using
git branch division_feature
After that I switched to this new branch.
git checkout division_feature
My working branch was set to division_feature
and I created a folder called division_data
. I added and committed this folder to the branch.
git add .
git commit -m "Added a branch specific folder"
According to the official documentation, now only my division_feature
branch should have this folder in my branch. But when I switched my repository back to master
, the division_data
directory was there in the master
branch as well.
git checkout master
ls
the division_data
directory was there which I think should not be happening as the git documentation clearly says.
That command did two things. It moved the HEAD pointer back to point to the master branch, and it reverted the files in your working directory back to the snapshot that master points to.
Can you please guide me where I am going wrong?