2

Windows 7 > Git Bash > git init creates a .git folder that has the Hidden Attribute, but nothing inside it is given that Attribute. I prefer to remove that Attribute (I un-tick it in FreeCommander XE > Properties), so that I can easily look inside from Explorer (which I prefer to leave at its default setting of hiding hidden stuff). Is there any technical reason why I should not do this (ie leave that 'git folder hidden)?

2 Answers 2

2

To answer your question as written: No. Git doesn't care or know whether or not that folder is hidden.

It adds that attribute by default on Windows to match the default-hidden behavior on other operating systems. It's hidden because it contains things needed for the management of the Git repository which should be transparent to the user, and there are very few reasons for said user to go digging around in there.

2
  • If, like me, you're curious as to how Git works, then looking in the .git folder can be helpful, particularly to see the settings in the config file. In GNU/Linux, a simple Ctrl+H unhides any hidden files (folders), not so simple in Windows.
    – joharr
    Apr 7, 2015 at 19:44
  • 1
    Interacting with the config file can also be done via git-config, e.g. git config --list to see all the settings. But I understand that it can be educational to poke around, which is why I finished with "very few reasons" rather than "no reason". :)
    – xathien
    Apr 7, 2015 at 22:22
1

No. There is no reason it's hidden except to keep a person from accidentally deleting it or changing it's contents.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.