views:

137

answers:

1

Use case:

-Visual Studio is open

-Master branch is clean (confirmed with git status)

-Checkout clean feature branch (confirmed with git status)

-Make changes in feature branch using visual studio IDE

-Commit Changes in feature branch

-git status check, everything commited to feature branch

-Checkout Master branch

PROBLEM: Master branch is no longer clean, some of the files that were altered in vStudio in the feature branch are not showing up as altered in the master branch.

We can't figure out if vStudio is caching and overwriting (which seems backwards from the way I know it work where it asks if you would like to reload) or if we are doing something wrong in GIT

Edited per comment below:

That is the problem, the master branch WAS clean, after working in feature branch and switching back to Master it is now showing files that were altered in the feature branch as being altered in the master branch

my understanding of git is that if you alter files in one branch, commit them, and then switch to another branch git would switch out the altered files for the correct versions in the other branch, what we are seeing is alteration in one branch is sometimes showing up in the other and we are speculating that perhaps this is due to visual studio caching (or something more evil)

A: 

It seems that VS did not reload altered files.

Check your Visual Studio settings under Environment - Documents, make sure "Detect when file is changed outside the environment" is checked.

Also, you can check whether it is a GIT problem by opening those files using other editors after checking out.

Iamamac
yea, it's somewhat 'random' to as when it happens, it doesn't seem to always happen and not for all files....
Tom DeMille
wondering if it's the 'check for consistent line endings setting. Postulating the following:1. a file that has never been edited since we switched to git is edited in the feature branch2. git auto-adjusts the line endings3. committed, switch back to master4. Visual studio reloads the file and also 'adjusts' the line endings5. viola, the file has 'changed' now in the other branchanyone know the implications of turning off the 'check for consistent line endings flag in vs, seems like if git is already doing this we don't need to do it twice..
Tom DeMille