0

How can I fix this issue?

I'm using Visual Studio 2017 for an MVC project using Git Version Control on Azure DevOps. When I create a new branch and make any changes, those same changes are being applied to the master branch and all other branches rather than staying isolated. When I go to look at the changes waiting to be staged for a commit, no matter what branch they're done in, the changes are applied to all other branches and also in the staged area.

Any ideas on what's going on here?

I appreciate any help on this.

  • 4
    Changes stay in your work tree or index until you tell Git what to do with them. If Git can check out another branch without conflict, it'll do that. Otherwise, it'll ask you to remove or commit them, or you can `git checkout -m` to do an ad-hoc merge and resolve the conflicts. You don't have to commit all your changes at once, and `git commit` has special options for committing the changes to just one file regardless of what's been added, specifically so you can properly commit small drive-by changes to a side branch with minimum disruption to your main effort. – jthill Jun 01 '19 at 00:17
  • just commit your changes – Alexan Jun 01 '19 at 00:20
  • 2
    Note that until you commit, your updated files have not been recorded in *any* branch (or more correctly, in any *commit:* branch names are not significant; they exist in part so that you don't have to memorize commit hash IDs). – torek Jun 01 '19 at 00:23
  • Possible duplicate of [Modified files in a git branch are spilling over into another branch](https://stackoverflow.com/questions/246275/modified-files-in-a-git-branch-are-spilling-over-into-another-branch) – phd Jun 01 '19 at 04:33

0 Answers0