Welcome to the Treehouse Community
Looking to learn something new?
Should I remove files from a git branch?
I've created a repository using Git for a coffee shop website I'm working on. I'd already started working on the site before I did the git course so I added the "initial commit" files half-way through. I've decided to re-write one of the sections (the ACF loop isn't currently working and I don't like the look of the page) so I've created a new branch (drinks_rewrite). I made changes to a single file page-drinks.php and then used the git add * option which I thought would only add that file (since it was the only modified file) but it appears to have added all of the files again to the new branch.
You can see the project on GitHub here https://github.com/JamesPaskUK/lazydays
My question is, if I remove the unchanged files from the drinks_rewrite branch, will that be OK? I did a quick Google which suggests that if files are removed from branches but these are then merged back with master at a later stage, they'll be removed from master. I, however, was under the impression if they were in master but not in a branch, then git would simply ignore them (i.e. keep them in master), merge changed files and add new ones.
Is this not the case?
How should I have added files to the branch so that I only got the ones that had changed?
Hope someone can help. Forgive me if these seem like dumb questions.. this is my first attempt at a repository on my own.