Windows git thinks my file is dirty

Do you have dirty files in git? Are you frustrated with how git thinks you’ve soiled a file that you haven’t actually touched? Are you looking for a way to tell git to stop bugging you? Hi I’m Cliff. You’re here because you have dirty files (but you have clean underwear). I’m here because I finally managed to work around a long standing issue where git thought my files were modified under Windows. The problem originates from machines with two different operating systems working on the same project. If you commit files from a *nix system and set the executable bit on then when you clone the project or pull the commit on Windows, git will treat these files as being altered. This is because the executable bit does not exist on Windows so the file appears different on the filesystem. To prevent git from treating these changes as different you should run this command:

git config core.fileMode false

That sets the global config for git to ignore file mode changes (things like read/write/execute). You can set it globally or use it for one off commands like:

git -c core.filemode=false diff

Create Windows 7 Install Disc On a Macbook Pro

I was trying to install Windows 7 on my Mac this morning and it turned out to be an all day affair! My biggest issue was trying to create a Windows 7 install disc on a USB flash drive using Boot Camp. (Boot Camp is software included with OS X Lion so you can run compatible versions of Microsoft Windows on an Intel-based Mac.) For reasons known only to Steve and finally now me, the checkbox that enables this magic was greyed out and disabled under Boot Camp. I found a thread in a forum discussing the issue and was able to fix it. (I lost the link to the thread but I’ll repeat the important parts here.) The fix involves editing an “Info.plist” file under the Boot Camp application bundle. For those that are not Mac savvy, apps on the Mac are simply folders (commonly referred to as bundles) with a “.app” suffix which causes the “Finder” application to treat them differently. You can right click any “.app” bundle and chose to “Show Package Contents” to look inside them.

So showing the contents of the “Boot Camp” app located under “/Applications/Utilities” will expose a “Contents” folder which contains the “Info.plist” file. Edit this file using the Dashcode app (I believe this installs with Xcode which is included on the Lion/Snow Leopard install media under the optional folder) and look for the “USBBootSupportedModels” setting in the left hand pane. Clicking the little triangle will expose/unfold a bunch of models that support USB booting. According to Apple, these are the only models that support the feature but you can alter this file to include the model of the Mac you currently use. Click the Apple icon in the top most menu and find the “About This Mac” option. click “More Info” then “System Report”. This is where you look to find your Model Identifier. Mine was MacBookPro6,2 which would translate to a MBP62 string. There is also a Boot Rom version in the same report a little further down that you should pay attention to. Mine was listed as MBP61.0057.B0C. I took this to mean that I should also include a MBP61 string in the list of supported models as well. Clicking the little plus icon next to “USBBootSupportedModels” will allow you to add strings for both your model and boot model. Save the file to your desktop. I was very carefully to rename the original file to something like Info.old.plist before copying the modified file back in place from my desktop. I also went in and changed the ownership of the file to “root:wheel” after copying. Follow these steps then when you restart Boot Camp the option should be available to you. Happy “Boot Camping!”