Re: What is the reason behind not hiding git worktrees from git?
- From
- Jason Cho <jason11choca@proton.me>
- Date
- Sep 27, 2025, 21:26 UTC
- Message-ID
- <GY1ni5SFkgBgVIHm9HoO9dtLuLWbUPCv5mjcsy5VGi09PyRLV_gv3MMw2zsinKpi5Aon9J-LESzTUuwMOUNLRRLqyXM7ON-98WTzhH7RIYY=@proton.me>
- In-Reply-To
- <KUIfhZpMUwujq7A0Qdiri2OEhWabUXUVVpHZb7o0A-iqAC_46qQd5acUqN9TlkFMGe2t-aY4IXFQCjs6gKsawBCGSazI3QDPigdI7KrRf_A=@proton.me>
I think the best practice is to not add a work tre within the master work tree.
Suppose a repo is at the master branch, and you export a work tree in the directory f.
Then, you check out the main repo to another branch which so happens to have a file named f. In this case, the check-out will fail due to the name collision.