-1

I created a master branch, then I added other branches from it, after that, I decided to add another file to the master branch but that file appears in all other branches, How to add a file to the master branch without adding it automatically to other branches with Git?

Othmane Namani
  • 325
  • 3
  • 16

1 Answers1

2

Probably you haven't committed your file yet. Uncommitted changes "follow" you as you switch branches. If you actually commit your new file while on master, then it will be associated with master specifically and stop "following" you to other branches.

Wolf
  • 4,254
  • 1
  • 21
  • 30