I'm working with Git for the first time. I have a project cloned and I am working on a branch with some changes... However, these changes had to be paused. So, while this is paused, I want to work on another feature for the same project. The changes for this new feature wouldn't affect the files modified/created in the first branch, they are in another directory in the same project.
Currently, if I create a new branch, I see the that the changes for the first branch appear also on the new branch...
What would be the correct way of doing this with Git (and the correct commands), without causing conflicts and have only each feature's changes in its respective branch?
Edit 1:
Sorry if this sounds like a dumb question, but I don't want to mess up the project repository... Would this work for what I'm trying to do?:
- Create a 2nd branch from my master.
- With my 2nd branch checked out, I make the changes for my second feature, and ONLY stage and commit these new changes to the 2nd branch (with git add <folder containing only 2nd feature changes>).
- When I'll be able to resume my 1st feature, I should check out my 1st branch, finish my changes, and only stage and commit these changes (with git add <folder containing only 1st feature changes>).
Does this make sense?