I created a 2nd branch on my master git called staging and check it out. This was because i was getting a bunch of untracked files and new files added message. I got rid of them in the new branch using git clean. This also updated my original branch as well which I believed should have been independent of my changes on the other branch. Any clues regarding that.
Share
Branches only store files you have committed. If you checked out another branch with a dirty working directory, the original branch is not altered to store that state. Using
git cleanoperates on your working directory, and your working directory is a completely independent thing from a branch.Look at
git stashif you want a way to store changes to the working directory without creating a proper commit.