0

I have 2 feature branches feature1, feature 2 and both are derived from the develop branch.

In feature1 I have a few newly created files. Not sure where I am wrong when I branched feature2 from develop branch the new files in feature1 could be seen in feature2. Also 1 file was changed in feature1, the changes are also showing up in feature2. I dont want the new files in feature2, I also do not want changes of the file changed in feature 1, as I want to change this file separately for feature2. Please help.

Commands used to create the feature branches while GIT Bash was pointing to develop branch are git checkout -b feature1 git checkout -b feature2

kshah
  • 11
  • 2

1 Answers1

0

If the changes are present in the working copy but not committed in feature1, and you switch to feature2, the changes will be still visible. Where else should git put them? Before switching branches, commit the changes, or use git stash to set them aside.

choroba
  • 231,213
  • 25
  • 204
  • 289