I am dual-booting Linux and Windows, and have git configured on both of them. When using Linux, is it safe to access the files directly from the Windows partition or should I just clone them from the remote repo for the new OS instead? thank you
Asked
Active
Viewed 301 times
1 Answers
3
The word safe is quite strong. You can definitely look around at the files in a foreign mount, but Git itself may behave oddly (and/or be extremely slow) if you try to do any actual work.
The reason is that Git's index (aka staging area or cache) contains cached data from the OS, and this cached data depends on the OS. Changing the underlying OS, then working with the repository, causes the cached data to be invalid.
Because the index itself is just a cache, it's possible to remove and rebuild it (rm .git/index && git reset
). This undoes any staging action though. Using separate clones is certainly safer, and is how I would recommend working.

torek
- 448,244
- 59
- 642
- 775