VS2019 change in newbranch also happens in master

Bill Pennock 1 Reputation point
2023-01-03T21:49:26.847+00:00

steps: In Visual Studio Community 2019

  1. Create a newbranch from Master
  2. switch to newbranch using git changes view locals
  3. make a code change to a file and save and close
  4. git changes show the changes but I haven't staged them yet
  5. switch to master same way
  6. wait for the background task to complete
  7. open up the file and it has the same changes I just made to newbranch

I don't get it?

Community Center | Not monitored
{count} votes

1 answer

Sort by: Most helpful
  1. Bill Pennock 1 Reputation point
    2023-01-03T23:51:33.69+00:00

    Answering my own question after doing further testing. I noticed in the message that offered to move the changes to master that it said uncommitted changes. I am a full time project manager that was a programmer and still do some programming. So maybe my memory was wrong but I don't believe I had to commit changes in a branch in order for them to stay in the branch. But if I do commit the changes in newbranch I can then change back to an unchanged master. If anyone knows how to avoid this by some sort of option let me know.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.