I am working with git, still fairly new to working with branches, and I am coming across a real odd problem. I am not sure what is going on to be honest.
I am creating a git repo then adding a readme to it, and committing the changes.
git init
git touch README
git add README
git commit -m 'add readme'
From there I now have a master branch. I do:
git branch development
git checkout development
From there I have added 3 folders of files, since I am adding an old project to source control for the first time. The folders are:
Theme-arm
FrontEnd
ControlPanel
My goal is to add these files to the development branch and no other branches. I then do
git add *
git commit -m 'initial commmit'
That all works good. However When I switch back to master with
git checkout master
The problem, and what is leading to my confusion, is that ControlPanel and FrontEnd, but not theme-arm are now in master as well. I don’t want them there, yet.
Am I doing something wrong or misunderstanding how git is working?
Check ControlPanel and FrontEnd for files that weren’t put under version control when you did
git add *in the development branch (you could just check what the contents of those directories are in your master branch).