new branch from clean working copy

Hi everyone! I know this is maybe a stupid question, but I am a newbie in Git. Let's suppose I am working on a project in the master branch and I am editing just one file, “file1.php”. Now my main manager tells me to develop a new feature and I create a new branch “new_feature”. In the “new_feature” branch, the changes I made to “file1.php” are still visible, and when I edit other files and make a commit in “new_feature”, the previous changes in “file1.php” are included in the new commit. But I do not want this, I want the changes of “file1.php” to be included in the master branch. When I have some file modifications, how can I create a new branch from a clean working copy? So the previous modifications are not included in the new branch. Thank you very much!

Last updated

1-2 of 2

Reply to this discussion

You cannot edit posts or make replies: You should be logged in before you can post.

Post a reply