0

in visual studio, I create a new branch from my master branch, write something new, and these changes also appear there when switching to the master branch.Can someone tell me how to configure it so that they do not go there automatically?Thanks

Alpharius
  • 489
  • 5
  • 12
  • 2
    Most likely this is the usual confusion of working directory vs. index/branch. Did you add and commit those changes on that new branch? If not, then git will try to preserve them when changing branches. There is no way to configure this away because git does not keep a copy of uncommitted files, so if those changes were deleted, you would lose them. Either commit or stash them before checking out master. – Lasse V. Karlsen Feb 19 '21 at 13:42
  • 2
    When you switch branches, uncommited changes stay in the working tree accross branches. Commit before switching. – Romain Valeri Feb 19 '21 at 13:42
  • @LasseV.Karlsen thanks you guys ;) – Alpharius Feb 19 '21 at 13:47
  • Esp. this answer: https://stackoverflow.com/a/246298/7976758 – phd Feb 19 '21 at 16:20

0 Answers0