3

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)

Tom DeMille
  • 3,207
  • 3
  • 23
  • 30
  • I don't understand this sentence, it seems to stay master is dirty, but also that master is not dirty? 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. – Pod Jan 14 '10 at 15:29
  • I see now. And yes, you're right, that's what should happen. Why not try ths same thing but with notepad, to see if it's VS at fault? – Pod Jan 14 '10 at 15:36
  • Check your `autocrlf` settings (see http://stackoverflow.com/questions/2016673/definitive-recommendation-for-git-autocrlf-settings and http://stackoverflow.com/questions/2016404/git-status-shows-modifications-git-checkout-file-doesnt-remove-them ) – VonC Jan 14 '10 at 16:01
  • ignorecase = true autocrlf = true safecrlf = false – Tom DeMille Jan 14 '10 at 16:21
  • `autocrlf = true` does not strike me as a safe setting (see the aforementioned links). You might want to check if the issue persists with `autocrlf = false`. – VonC Jan 14 '10 at 16:35

1 Answers1

2

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
  • 9,632
  • 4
  • 35
  • 30
  • yea, it's somewhat 'random' to as when it happens, it doesn't seem to always happen and not for all files.... – Tom DeMille Jan 14 '10 at 15:51
  • 1
    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 branch 2. git auto-adjusts the line endings 3. committed, switch back to master 4. Visual studio reloads the file and also 'adjusts' the line endings 5. viola, the file has 'changed' now in the other branch anyone 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 Jan 14 '10 at 15:54